Overview
nmis-cli is the main command-line tool for performing NMIS system administration tasks including job scheduling, outage management, database operations, and system maintenance.
Location: ~/bin/nmis-cli
Version: 9.6.5
Command-Line Options
Set debugging level (0-9). Higher values produce more verbose output.
Display detailed help information and exit.
Suppress non-essential output messages.
Display brief usage information and exit.
Enable verbose output mode.
Display version information and exit.
Core Actions
System Maintenance
fixperms
Fix file permissions for NMIS directories and files.Requires root privileges. Sets ownership to configured
nmis_user:nmis_group and applies appropriate permissions.config-backup
Create a backup of the current NMIS configuration.gettmp (or gettemp)
Display the temporary directory path used by NMIS.Database Operations
ensure-indexes
Ensure all required database indexes exist. Optionally remove unwanted indexes.Remove indexes that are not defined in the schema.
dbcleanup
Clean up old data from the database according to retention policies.Dry-run mode - show what would be deleted without actually deleting.
Display detailed information about cleanup operations.
Use optimized performance queries for large datasets.
purge
Purge old files according to configured retention policies.Data Operations
noderefresh
Refresh all nodes in the database, updating metadata and running validation.inventoryrefresh
Refresh inventory data for all nodes.remove-duplicate-events
Identify and archive duplicate events in the database.System Status
daemon-status (or status)
Display the status of NMIS daemon processes.Job Scheduling
schedule
Schedule a job for execution by the NMIS daemon.When to run the job. Uses
at command time format (e.g., “now”, “now+1hour”, “16:00”, “tomorrow”).Type of job to schedule. One of:
collect, update, update_links, services, thresholds, escalations, metrics, configbackup, purge, dbcleanup, selftest, permission_test, plugins, delete, edit.Job priority between 0 (lowest) and 1 (highest). Manual jobs default to 1.
Node name (can be repeated for multiple nodes).
Node UUID (can be repeated for multiple nodes).
Node group name (can be repeated for multiple groups).
For collect jobs: enable SNMP collection.
For collect jobs: enable WMI collection.
For plugin jobs:
update or collect.Bypass scheduling policies and ignore cached data.
Job-specific verbosity:
1-9, debug, info, warn, error, or fatal.Save job output to separate file:
/path/prefix or prefix. Path is relative to log directory.Tag for grouping related jobs (e.g., for post-operation plugins).
list-schedules
List pending and active scheduled jobs.Display full job arguments.
Filter:
active (in-progress only) or queued (pending only).Filter by job properties (e.g.,
job.type=collect, job.priority=1).delete-schedule
Remove scheduled job(s) from the queue.Schedule ID to delete, or
ALL to delete multiple jobs (with filters).abort
Abort an active job and terminate its worker process.schedule-help
Display detailed help for job scheduling.Outage Management
create-outage
Create a new outage schedule.Free-form textual description of the outage.
Change management ticket identifier for event tagging.
Outage frequency:
once, daily, weekly, or monthly.Outage start time. Format depends on frequency:
- daily: “HH:MM” or “HH:MM:SS”
- weekly: “MDAY HH:MM” (e.g., “Mon 08:00”)
- monthly: “D HH:MM” (day 1-31, or -1 for last day)
- once: ISO8601 datetime (e.g., “2024-12-15T22:00:00+0000”)
Outage end time (same format as start). Note: “24:00” is allowed for daily outages.
Key-value pairs to adjust NMIS behavior during outage.
Device selection criteria. Keys:
node.X or config.Y. Values: string, /regex/, or array (use indexed entries). All selectors must match for a node to be affected.update-outage
Update an existing outage schedule.Outage UUID to update.
show-outage
Display details for a specific outage.list-outages
List all or filtered outages.Any outage property to filter on. Supports regex with
/pattern/ or /pattern/i.delete-outage
Delete an outage schedule.check-outages
Check which outages apply to a node at a specific time.Node name to check outages for.
Node UUID to check outages for.
Time to check (Unix timestamp, or parseable datetime string).
outage-help
Display detailed help for outage management.Reports
run-reports
Generate reports for a specific time period.Report period:
day, week, or month.Report type:
all, times, health, top10, outage, response, avail, or port.Performance Data Collection
collect-performance-data
Collect system performance data from the NMIS server.Reads configuration from
conf/performance and stores output in <nmis_var>/system_performance.collect-top-data
Collect system top/CPU/memory statistics.User Session Management
clean-sessions
Remove all active sessions for a user.get-sessions
Display active session counts for all users.set-last-login
Manually set the last login time for a user.Username to update.
Unix timestamp for last login time.
unlock-user
Unlock a locked user account.Event Notifications
notify
Manually trigger an event notification.Node name (use
node or uuid).Node UUID (use
node or uuid).Event name.
Affected element (e.g., interface name).
Additional event details.
Event severity:
Normal, Warning, Minor, Major, Critical, or Fatal.When
level=Normal, the event is cleared. Other levels create/update an active event.Exit Codes
- 0: Success
- 1: General error
- 255: Invalid action or parameters
Environment Variables
None required. Configuration is loaded from NMIS config files.Files
- Log File:
<nmis_logs>/cli.log - Config:
<nmis_conf>/Config.nmis - Temp Dir: Retrieved via
act=gettmp
Examples
Complete Maintenance Workflow
Database Maintenance
See Also
- node-admin.pl - Node management operations
- model_tool.pl - Model development and testing
- NMIS Configuration Guide
- Job Scheduling Documentation