Nagios Core External Commands

< Back to external commands list


Command Format:

Allows you to send a custom service notification. Very useful in dire situations, emergencies or to communicate with all admins that are responsible for a particular service. When the service notification is sent out, the $NOTIFICATIONTYPE$ macro will be set to "CUSTOM". The <options> field is a logical OR of the following integer values that affect aspects of the notification that are sent out: 0 = No option (default), 1 = Broadcast (send notification to all normal and all escalated contacts for the service), 2 = Forced (notification is sent out regardless of current time, whether or not notifications are enabled, etc.), 4 = Increment current notification # for the service(this is not done by default for custom notifications). The comment field can be used with the $NOTIFICATIONCOMMENT$ macro in notification commands.

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

now=`date +%s`

/bin/printf "[%lu] SEND_CUSTOM_SVC_NOTIFICATION;envirosensor;Water Level;3;Ethan;The NOC is currently flooding.  Help!\n" $now > $commandfile    
Command Categories:


Nagios Version(s):

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.