Date: Fri, 29 Mar 2024 09:45:35 +0000 (UTC) Message-ID: <624255773.4093.1711705535927@skald.opmantek.com> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_4092_900888726.1711705535927" ------=_Part_4092_900888726.1711705535927 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
To assist with integrating NMIS with other network management sy= stems, NMIS includes a little script for importing nodes from a CSV file. F= rom version 8.5.4G onwards there are also more fine-grained tools available= , which are described on the page titled Node Administration Tools.
The bulk import script can be found in /usr/local/nmis8/admin/import_nod= es.pl and there is a sample CSV file /usr/local/nmis8/admin/samples/import_= nodes_sample.csv.
The minimum properties you need to have to add a device to NMIS are, nam= e, host, group, role and community. Technically you can use defaults = for group and role and the name and host maybe the same, so the absolute mi= nimum is host and community. This sample CSV includes the full five p= roperties and if required you can use additional ones.
name,host,group,r= ole,community import_test1,127.0.0.1,Branches,core,nmisGig8 import_test2,127.0.0.1,Sales,core,nmisGig8 import_test3,127.0.0.1,DataCenter,core,nmisGig8
To load these devices into NMIS8 run the following command
/usr/local/nmis8/= admin/import_nodes.pl csv=3D/usr/local/nmis8/admin/import_nodes_sample.csv = nodes=3D/usr/local/nmis8/conf/Nodes.nmis.new
This will take the CSV file and merge it with the existing /usr/local/nmis8/conf/Nodes.= nmis file and create a new nodes file /usr/local/nmis8/conf/Nodes.nmis.new. <= /span>Merging the fi= les means that you can use this script and CSV to update existing propertie= s of devices as well as adding new devices, perfect for integration into ot= her systems and to create automated processes.
Once you have cre= ated /us= r/local/nmis8/conf/Nodes.nmis.new you need to replace the existing Nodes.nm= is file and it is a good idea to keep a backup, running these two commands = together is a good idea.
mv /usr/local/nmi= s8/conf/Nodes.nmis /usr/local/nmis8/conf/Nodes.nmis.old mv /usr/local/nmis8/conf/Nodes.nmis.new /usr/local/nmis8/conf/Nodes.nmis /usr/local/nmis8/admin/fixperms.pl
Once you have added nodes or modified nodes an NMIS Update is required w= hich you can run in the background or run for a single node.
To run an NMIS update in the background, the command nohup is No Hangup,= so you can exit the SSH session if required, this will continue running.= p>
nohup nice /usr/l= ocal/nmis8/bin/nmis.pl type=3Dupdate mthread=3Dtrue maxthreads=3D5 &
To run an NMIS update for a single node, optionally with debug.
/usr/local/nmis8/= bin/nmis.pl type=3Dupdate node=3DNAME_OF_NODE [debug=3Dtrue]
If adding a large number of devices it might take sometime to complete t= he adding, it might be better to add them in batches. This is because= the first time a node is added to NMIS it needs to create all the RRD file= s for performance data, this only takes a few seconds per file, but each no= de may have 10 RRD files or more, so this compounds to a large number of se= conds very fast when adding 1000's of devices at a time. You can susp= end cron from running the NMIS polling by modifying /etc/cron.d/nmis , comm= ent out the type=3Dcollect line, like this:
#################= ##################################### # Run Statistics Collection #*/5 * * * * /usr/local/nmis8/bin/nmis.pl type=3Dcollect mthread=3Dtrue max= threads=3D8
Then when finished adding the files and doing the update, run the first = collect manually
nohup /usr/local/= nmis8/bin/nmis.pl type=3Dcollect mthread=3Dtrue maxthreads=3D8 &
When this is finished re-enable the collection in cron by removing the c= omment.
To handle importing nodes with SNMPv3, check out this article: Im= porting Nodes into NMIS8 with SNMPv3 Credentials