Nagios Core External Commands

< Back to external commands list

ADD_HOST_COMMENT

Command Format:
ADD_HOST_COMMENT;<host_name>;<persistent>;<author>;<comment>
Description:

Adds a comment to a particular host. If the "persistent" field is set to zero (0), the comment will be deleted the next time Nagios is restarted. Otherwise, the comment will persist across program restarts until it is deleted manually.

Shell Script Usage Example:
#!/bin/sh
# This is a sample shell script showing how you can submit the ADD_HOST_COMMENT command
# to Nagios. Adjust variables to fit your environment as necessary.

now=`date +%s`
commandfile='/usr/local/nagios/var/rw/nagios.cmd'

/bin/printf "[%lu] ADD_HOST_COMMENT;host1;1;Some Author;This is a test comment\n" $now > $commandfile    
Command Categories:

Comments
Hosts

Nagios Version(s):

1.x, 2.x, 3.x, 4.x

Nagios, Nagios Core, NRPE, NSCA, and the Nagios logo are trademarks, servicemarks, registered servicemarks or registered trademarks of Nagios Enterprises. All other trademarks, servicemarks, registered trademarks, and registered servicemarks mentioned herein may be the property of their respective owner(s). The information contained herein is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.