Date: Thu, 28 Mar 2024 17:41:52 +0000 (UTC) Message-ID: <1614878860.3928.1711647712917@skald.opmantek.com> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_3927_1642001666.1711647712916" ------=_Part_3927_1642001666.1711647712916 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
UUID's for Nodes in NMIS is now fully integrated and just work, = especially when using the GUI or the tools to maintain nodes, you will not = need to worry about them.
You might see an error message like this:
ERROR: the improb= able has happened, a UUID conflict has been found for 59A2847C-8D41-11E2-A9= 90-F38D7588D2EB, between YINYANG and FOOBAR
The most likely thing to have occurred is that someone cloned/copied the= node YINYANG and called it FOOBAR, changed other settings but not the UUID= .
To fix this problem, just delete the UUID from the newly added node and = NMIS will automatically create a new UUID and update the system automatical= ly.
NMIS version 8.3.19G or greater.
The perl library Data::UUID to be installed.
Unix Shell access to the NMIS server and suitable Unix privileges to edi= t the NMIS configuration files, usually a member of the group "nmis" or the= root user.
Some NMIS users require a Unique Identifier for each node, so Opmantek h= as added this for those users who require it. To have NMIS add a UUID= for each node, you can enable this to be added and exported as required. &= nbsp;This capability uses Custom Tables to have NMIS add a UUID when adding= a node.
A UUID might be useful or required when integrating NMIS with third part= y applications like HP Service Manager, or when using NMIS as your source o= f truth for integration with a CMDB or other database system.
A new module has been added in NMIS 8.3.19G called NMIS::UUID, this is r= equired to support UUID's.
Modify the file /usr/local/nmis8/conf/Table-Nodes.nmis and add the follo= wing code.
use NMIS::UUID; --snip-- my $uuid; if ( $C->{uuid_add_with_node} eq "true" ) { $uuid =3D getUUID(); } --snip-- { uuid =3D> { header =3D> 'UUID',display =3D> 'header,readonly',va= lue =3D> ["$uuid"] }},
In context these changes look like this:
use NMIS; use Auth; use NMIS::UUID; my $C =3D loadConfTable(); # variables used for the security mods my $AU =3D Auth->new(conf =3D> $C); # Auth::new will reap init values= from NMIS::config # Calling program needs to do auth, then set the ENVIRONMENT before this is= called. $AU->SetUser($ENV{'NMIS_USER'}); my @groups =3D (); my $GT =3D loadGroupTable(); foreach (sort split(',',$C->{group_list})) { push @groups, $_ if $AU->= ;InGroup($_); } my @nodes =3D (); my $LNT =3D loadLocalNodeTable(); # load from file or db foreach (sort {lc($a) cmp lc($b)} keys %{$LNT}) { push @nodes, $_ if $AU-&g= t;InGroup($LNT->{$_}{group}); } my @models =3D (); if ( opendir(MDL,$C->{'<nmis_models>'}) ) { @models =3D ('automatic',sort {uc($a) cmp uc($b)} (grep(s/^Model-(.*)\.nmi= s$/$1/,readdir MDL))); } else { print Tr(td({class=3D>'error'},"Error on loading models names from dire= ctory $C->{'<nmis_models>'}")); } closedir(MDL); my $uuid; if ( $C->{uuid_add_with_node} eq "true" ) { $uuid =3D getUUID(); } return ( Nodes =3D> [ # using an array for fixed order of fields { name =3D> { header =3D> 'Name',display =3D> 'key,header,text',v= alue =3D> [""] }}, { uuid =3D> { header =3D> 'UUID',display =3D> 'header,readonly',v= alue =3D> ["$uuid"] }}, { host =3D> { header =3D> 'Name/IP Address',display =3D> 'header,= text',value =3D> [""] }}, --snip--
You can use the configuration uuid_add_with_node set to true to ena= ble a UUID to be added or disable it with false to allow the other methods = to maintain the UUID.
'uuid_add_with_no= de' =3D> 'true',
The sample script /usr/local/nmis8/admin/export_nodes.pl has been modifi= ed to include the UUID in the export. You can review this code to see= how it is added. This code also uses the method createNodeUUID to cr= eate UUID's which might be missing from the nodes file.
A script has been included /usr/local/nmis8/admin/uuid_update_nodes.pl w= hich will add any missing UUID's as well as maintain/update the file /usr/l= ocal/nmis8/conf/UUID.nmis which is a two way index for determining the UUID= of devices and visa versa. The error below was introducted intention= ally.
[keiths@nmisdev64= nmis8]$ admin/uuid_update_nodes.pl=20 0.00 Begin ERROR: the improbable has happened, a UUID conflict has been found for 59A2= 847C-8D41-11E2-A990-F38D7588D2EB, between YINYANG and FOOBAR 0.02 Begin