...
NMIS provides a number of different methods for managing your nodes, both GUI-based and commandline-oriented. This document describes the commandline tools present in versions 8.5.4 and newer.
Import nodes to NMIS9 from NMIS8
To import nodes from NMIS8 to NMIS9 copy /path/to/nmis8/conf/Nodes.nmis to /tmp/ on NMIS9 installation then:
Code Block |
---|
/usr/local/nmis9/admin/node_admin.pl act=import_bulk nodes="/tmp/Nodes.nmis" |
Caveats: you can not import a node to a server if there is already a node existing with that name, you should rename the node before importing.
Bulk Import and Export
For importing lots of nodes in one go from a CSV file, NMIS has been providing admin/import_nodes.pl
for a long time. There is also a sibling admin/export_nodes.pl
tool, and both are documented on the Bulk Import page. The main benefit of these tools is utmost simplicity, but at the cost of some flexibility: import_nodes
does not make all common node properties controllable or accessible.
...
The node admin tool in NMIS9 brings some enhancements.
...
.
Backup, Migrate or just play with a Node
...
Caveats: you can not restore a node to a server if there is already a node existing with that name, you should rename the node before dumping. This would include if the server was acting as a master and receiving the node from a remote poller.
Copy a Node
To make a duplicate node and start polling it, export the node, edit the json and import it, e.g.
Code Block |
---|
/usr/local/nmis9/admin/node_admin.pl act=export node=NODENAME file=NODENAME.json |
Edit NODENAME.json, change the display_name and name in the file and then import it
Code Block |
---|
/usr/local/nmis9/admin/node_admin.pl act=import file=NODENAME.json |
The node will be created with the name used in the name field.
NMIS9 Basic Operation
Run the tool with no options or -? or -h and it'll display a simple help page:
Code Block |
---|
Usage: node_admin.pl act=[action to take] [extras...] node_admin.pl act={list|list_uuid} [node=X] [group=Y] node_admin.pl act=show node=nodeX node_admin.pl act={create|update} file=someFile.json node_admin.pl act=export [format=nodes] [file=path] {node=nodeX|group=groupY} [keep_ids=0/1] node_admin.pl act=import file=somefile.json node_admin.pl act=import_bulk {nodes=filepath|nodeconf=dirpath} node_admin.pl act=delete {node=nodeX|group=groupY} node_admin.pl act=dump {node=nodeX|uuid=uuidY} file=path [everything=0/1] node_admin.pl act=restore file=path [localise_ids=0/1] node_admin.pl act=set node=nodeX entry.X=Y... node_admin.pl act=mktemplate [placeholder=1/0] node_admin.pl act=rename old=nodeX new=nodeY [entry.A=B...] mktemplate: prints blank template for node creation, optionally with __REPLACE_XX__ placeholder create: requires file=NewNodeDef.json update: updates existing node from file=someFile.json export: exports to file=someFile (or STDOUT if no file given), either json or as Nodes.nmis if format=nodes is given uuid and cluster_id are NOT exported unless keep_ids is 1. delete: only deletes if confirm=yes (in uppercase) is given, if deletedata=true (default) then RRD files for a node are also deleted. show: prints a node's properties in the same format as set with option quoted=true, show adds double-quotes where needed set: adjust one or more node properties restore: restores a previously dumped node's data. if localise_ids=true (default: false), then the cluster id is rewritten to match the local nmis installation. extras: debug={1..9,verbose} sets debugging verbosity extras: info=1 sets general verbosity |