Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Table of Contents

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.

Related Documentation

Import nodes to NMIS9 from NMIS8

...

The creation of nodes requires you to use a template (shown below) instead of using a command line argument; this . This is because NMIS requires numerous node properties to be set up correctly making it easy to miss some when operating via command line arguments. Node creation is triggered by the argument act=create, which behaves mostly like act=update, except that it doesn't touch existing nodes. To help you with starting a node configuration document from scratch (or in a scripted fashion), there is another command, act=mktemplate, which prints a blank but documented template which you can save and fill in. If you add placeholder=1 to the command line, then node_admin fills the template with easily matchable replacement placeholders, like so:

...

To restore a node to the same poller you would not need to use the localise_ids option, if . If you wanted to copy/migrate the node to another server you would need to localise the ids so that the poller thinks it the node belongs to it. 

When the below command is executed, you will overwrite the previous cluster_id with the cluster_id of the NMIS server you are migrating/copying the node to.

Code Block
/usr/local/nmis9/admin/node_admin.pl act=restore file=NODENAME-dump.zip localise_ids=1true

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 Primary and receiving the node from a remote poller.

...

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

FAQ

Cluster and server mismatch!

When creating/updating a node, there are a couple of reasons this message can appear:

  • Server parameter is specified: The parameter is used if we want to send the node to a remote peer, and is optional. If the server does not exist (This is not the local server or this is not from any of the opHA peers), we will see this message. Also, the cluster_id needs to be specified in the json node data, and match with the server_id from the poller. Please notice this action is not online, please check the opHA guide for further details. 
  • The json from the node includes a cluster_id which does not exist. Doesn't exist has the same meaning as above. If the cluster_id is not specified in the node data, nmis9 will import the node with the local cluster_id, which means, we can also omit that parameter.

Status
colourYellow
titleTIP
 To create a json template for a node, we can use ./node_admin.pl act=mktemplate placeholder=1

Invalid server!

When creating/updating a node, nmis9 does not have this node registered. 

This can be fixed in opHA, editing the peer.

Related Topics