NMS Agent
NMS Agent Overview
The NMS Agent is a Java process which runs as the NMS administrative user on the machine where NMS Services run. With dual-environment configuration, both administrative users have an NMS Agent instance installed and running. The Agent has various monitor tasks, which store the most recent results in memory.
Monitoring
The NMS Agent runs $HOME/.nmsrc to get the current NMS environment variables. It then watches the files $HOME/.nmsrc and $NMS_HOME/.nms-site-rc for changes and will re-run $HOME/.nmsrc if either file changes.
At intervals, NMS Agent will
• Check the current NMS version from the file $NMS_ROOT/nms/inventory/nms_version.xml.
• Run the NMS utility oem-util to check the status of NMS services.
Web Service
NMS Agent runs a web service that NMS Monitor uses to get the status of the NMS environment.
Security
The NMS Agent web service uses X.509 certificate based authentication to allow the NMS Monitor to make requests.
Logs
The NMS Agent writes its log to the file $NMS_LOG_DIR/nmsagent.log and saves its process ID to $NMS_LOG_DIR/nmsagent.pid. Daily log rotation places old logs into the $NMS_LOG_DIR/old_logs/ directory. Under normal conditions, very little is written to the log unless services stop or fail.
Configuration
The NMS Agent configuration is stored in the $NMS_HOME/etc/nmsagent directory. The primary configuration is the file $NMS_HOME/etc/nmsagent/nmsagent.properties.
It is a requirement that the $HOME/.profile file of each NMS administrative user sources the .nmsrc script. The following steps must be done for each NMS administrative user.
Install NMS Agent
The NMS Agent is provided with the NMS install in the $NMS_BASE/nmsagent directory. This must be copied to $NMS_HOME/nmsagent each time a new version of nmsagent is installed. This will avoid the need to regenerate the service script each time a new release is installed. This can be done with the following command:
rsync -avL --delete "$NMS_BASE/nmsagent/" "$NMS_HOME/nmsagent"
It is important to make sure that the executable to $NMS_HOME/nmsagent/bin/nmsagent is a valid link or executable.
Configure NMS Agent
Nms-agent-config is an interactive configuration tool. Run $NMS_HOME/nmsagent/bin/nms-agent-config and follow the on-screen prompts to perform the following configuration.
• Configure Server
• Set hostname: Enter the hostname or IP address that the NMS Agent should listen on for requests from NMS Monitor.
• Set port: Enter the port NMS Agent should listen on. The default value is 9988. For dual-environment configuration, make sure to set this to different values for the two environments.
• Set protocol (Optional): Set the protocol NMS agent will use. The default is https. Valid values are “https” and “http”.
• Set interval (Optional): Set the interval (in milliseconds) at which NMS Agent will poll NMS. The default value is 5000.
• Keystore Actions
• Set keystore location: Set the location of the NMS Agent keystore. Press enter to choose $NMS_HOME/etc/nmsagent/nmsagent_keystore.p12
• Create keystore: Generate the keystore and certificate used for certificate-based authentication with NMS Monitor. You will be prompted to enter certificate details.
• Export certificate: Export the NMS Agent certificate to a file. This will need to be imported into the NMS Monitor truststore.
• Truststore actions
• Set truststore location: Set the location of the NMS Agent truststore. Press enter to choose $NMS_HOME/etc/nmsagent/nmsagent_truststore.p12
• Create truststore: Create the truststore.
• Import certificate: Import certificate into truststore. Use this to import the NMS Monitor certificate that was created during NMS Monitor configuration.
• Generate Service Script
• Generate Service Script: This generates a file for installing a system service. Once run, follow the instructions given to install NMS Agent as a systemd service. The service will be nmsagent-${LOGNAME} (for example, nmsagent‑nmsadmin, if the NMS administrative user is named nmsadmin).
Start NMS Agent
Are the root user, run the systemctl start command using the service name generated in the Configure NMS Agent section to start NMS Agent. For example:
systemctl start nmsagent-nmsadmin