Overview
The node_admin.pl tool is the primary command-line interface for managing NMIS nodes. It provides comprehensive functionality for creating, updating, deleting, and exporting node configurations.
Location: /usr/local/nmis9/admin/node_admin.pl
Global Options
All commands support these global options:
debug=<level> - Set debugging verbosity (0-9, or info/warn/error/fatal/verbose)
quiet=true|false - Suppress unnecessary output
skip_ha_warnings=true|false - Suppress warnings when server role is not Standalone
dir=<path> - Specify custom configuration directory
Node Operations
List Nodes
/usr/local/nmis9/admin/node_admin.pl act=list
Lists all nodes in the system.
/usr/local/nmis9/admin/node_admin.pl act=list node=router1,router2
Lists specific nodes by name.
/usr/local/nmis9/admin/node_admin.pl act=list group=core wantstatus=true
Lists nodes in a group with active/collect status.
/usr/local/nmis9/admin/node_admin.pl act=list wantuuid=true wantgroup=true wantpoller=true
Lists nodes with UUID, group, and poller information.
/usr/local/nmis9/admin/node_admin.pl act=list format=json file=nodes.json
Exports node list to JSON format.
Show Node Configuration
/usr/local/nmis9/admin/node_admin.pl act=show node=router1
Displays complete configuration for a node.
/usr/local/nmis9/admin/node_admin.pl act=show uuid=<node-uuid> quoted=true
Shows configuration with quoted values for easy copying.
/usr/local/nmis9/admin/node_admin.pl act=show node=router1 interfaces=true
Displays node configuration with interface information.
/usr/local/nmis9/admin/node_admin.pl act=show node=router1 inventory=true
Shows all inventory data for the node.
/usr/local/nmis9/admin/node_admin.pl act=show node=router1 catchall=true
Displays only the catchall inventory data.
Create Node
Create template file
First, generate a template:/usr/local/nmis9/admin/node_admin.pl act=mktemplate > newnode.json
Edit the template
Edit newnode.json with your node details:{
"name": "router1",
"host": "192.168.1.1",
"group": "core",
"community": "public",
"version": "snmpv2c",
"port": "161",
"collect": true,
"ping": true,
"model": "automatic"
}
Create the node
/usr/local/nmis9/admin/node_admin.pl act=create file=newnode.json
Update Node
Update Single Property
/usr/local/nmis9/admin/node_admin.pl act=set node=router1 entry.configuration.community=private
Updates the SNMP community string.
/usr/local/nmis9/admin/node_admin.pl act=set node=router1 entry.configuration.collect=false
Disables collection for a node.
Update Multiple Properties
/usr/local/nmis9/admin/node_admin.pl act=set node=router1 \
entry.configuration.host=192.168.1.10 \
entry.configuration.group=distribution
Update Multiple Nodes
/usr/local/nmis9/admin/node_admin.pl act=set group=core \
entry.configuration.snmpTimeout=5000
Updates SNMP timeout for all nodes in the core group.
Update from File
/usr/local/nmis9/admin/node_admin.pl act=update file=updated-router1.json
Updates a node from a JSON file containing complete configuration.
Unset Node Properties
/usr/local/nmis9/admin/node_admin.pl act=unset node=router1 \
entry.configuration.notes
Removes the notes property from node configuration.
You cannot unset critical properties like name or cluster_id.
Rename Node
/usr/local/nmis9/admin/node_admin.pl act=rename old=router1 new=core-router1
Renames a node while preserving all configuration and data.
Delete Node
/usr/local/nmis9/admin/node_admin.pl act=delete node=router1 confirm=YES
Deletes a node and its RRD files.
/usr/local/nmis9/admin/node_admin.pl act=delete node=router1,router2,router3 confirm=YES
Deletes multiple nodes.
/usr/local/nmis9/admin/node_admin.pl act=delete group=retired \
deletedata=false confirm=YES
Deletes nodes in a group but keeps RRD data.
Deletion requires confirm=YES (uppercase) to prevent accidental deletions. This operation is irreversible.
Import and Export
Export Nodes
Export Single Node
/usr/local/nmis9/admin/node_admin.pl act=export node=router1 file=router1.json
Exports a node in NMIS9 JSON format.
Export Multiple Nodes
/usr/local/nmis9/admin/node_admin.pl act=export group=core file=core-nodes.json
Exports all nodes in a group.
/usr/local/nmis9/admin/node_admin.pl act=export format=nodes file=nodes.nmis
Exports in legacy NMIS8 Perl hash format.
/usr/local/nmis9/admin/node_admin.pl act=export format=nodes file=nodes.json
Exports in legacy NMIS8 JSON format.
Export with IDs
/usr/local/nmis9/admin/node_admin.pl act=export node=router1 \
keep_ids=true file=router1-with-ids.json
Exports node including UUID and cluster_id (useful for migrations).
Import Nodes
/usr/local/nmis9/admin/node_admin.pl act=import file=nodes.json
Imports nodes from NMIS9 JSON format file.
/usr/local/nmis9/admin/node_admin.pl act=import-bulk nodes=/path/to/nodes.json
Imports nodes from NMIS8 format.
/usr/local/nmis9/admin/node_admin.pl act=import-bulk nodes=/path/to/nodes.json \
nmis9_format=true
Imports bulk nodes in NMIS9 format.
Import Node Overrides
/usr/local/nmis9/admin/node_admin.pl act=import-bulk nodeconf=/path/to/nodeconf/
Imports node override configurations from a directory of JSON files.
Backup and Restore
Dump Node Data
/usr/local/nmis9/admin/node_admin.pl act=dump node=router1 \
file=/backup/router1-dump.json
Creates a complete backup including configuration and recent operational data.
/usr/local/nmis9/admin/node_admin.pl act=dump uuid=<node-uuid> \
file=/backup/node-dump.json everything=true
Creates a complete backup including all historical data, events, and RRD files.
Restore Node Data
/usr/local/nmis9/admin/node_admin.pl act=restore file=/backup/router1-dump.json
Restores a node from a backup.
/usr/local/nmis9/admin/node_admin.pl act=restore \
file=/backup/node-dump.json localise_ids=true
Restores a node and rewrites cluster_id to match local installation.
Advanced Operations
Clean Node Events
/usr/local/nmis9/admin/node_admin.pl act=clean-node-events node=router1
Removes all events associated with a specific node.
Validate Node Inventory
/usr/local/nmis9/admin/node_admin.pl act=validate-node-inventory \
concept=interface dryrun=true
Validates inventory records for a specific concept without making changes.
/usr/local/nmis9/admin/node_admin.pl act=validate-node-inventory \
make_historic=true
Validates all inventory and marks obsolete items as historic.
Move NMIS8 RRD Files
/usr/local/nmis9/admin/node_admin.pl act=move-nmis8-rrd-files node=router1
Migrates RRD files from NMIS8 structure to NMIS9 structure.
/usr/local/nmis9/admin/node_admin.pl act=move-nmis8-rrd-files ALL \
remove_old=true
Migrates all RRD files and removes old copies after verification.
Scheduling Node Operations
Many operations support scheduling for deferred execution:
/usr/local/nmis9/admin/node_admin.pl act=set node=router1 \
entry.configuration.community=newcommunity \
schedule=true time="now + 1 hour" priority=0.9
Schedules a configuration change for future execution.
/usr/local/nmis9/admin/node_admin.pl act=delete node=router1 \
confirm=YES schedule=true time="2024-01-15T22:00:00"
Schedules a node deletion at a specific time.
Remote Poller Operations
For distributed NMIS installations with remote pollers:
/usr/local/nmis9/admin/node_admin.pl act=create file=newnode.json \
server=poller1
Creates a node on a remote poller.
/usr/local/nmis9/admin/node_admin.pl act=set node=router1 \
entry.configuration.group=remote server=poller1
Updates a node on a remote poller.
Best Practices
- Always backup before bulk operations: Use
act=export or act=dump before large-scale changes
- Use simulate mode: Test operations with
dryrun=true or simulate=true when available
- Verify with show: Use
act=show to verify changes after modifications
- Use UUIDs for scripts: UUIDs are more reliable than node names in automation
- Schedule risky operations: Use scheduling for operations during maintenance windows
Troubleshooting
Node Creation Fails
Check that all required fields are present in the JSON file:
name - unique node name
host - IP address or hostname
group - valid group name
Import Fails with UUID Conflicts
If importing nodes from another system:
# Strip UUIDs from export
/usr/local/nmis9/admin/node_admin.pl act=export group=all \
keep_ids=false file=nodes-no-ids.json
Permission Issues
Ensure files have correct ownership:
/usr/local/nmis9/bin/nmis-cli act=fixperms
See Also