Herramientas de usuario

Herramientas del sitio


Barra lateral

manuales:nagios:capacitacion:anexo_-_comandos_externos

Comandos externos

ACKNOWLEDGE_HOST_PROBLEM

Command Format: ACKNOWLEDGE_HOST_PROBLEM;<host_name>;<sticky>;<notify>;<persistent>;<author>;<comment>

Description: Allows you to acknowledge the current problem for the specified host. By acknowledging the current problem, future notifications (for the same host state) are disabled. If the “sticky” option is set to two (2), the acknowledgement will remain until the host returns to an UP state. Otherwise the acknowledgement will automatically be removed when the host changes state. If the “notify” option is set to one (1), a notification will be sent out to contacts indicating that the current host problem has been acknowledged. If the “persistent” option is set to one (1), the comment associated with the acknowledgement will survive across restarts of the Nagios process. If not, the comment will be deleted the next time Nagios restarts.

Shell Script Usage Example:

#!/bin/sh
# This is a sample shell script showing how you can submit the ACKNOWLEDGE_HOST_PROBLEM 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] ACKNOWLEDGE_HOST_PROBLEM;host1;2;1;1;Some One;Some Acknowledgement Comment\n" $now > $commandfile

ACKNOWLEDGE_SVC_PROBLEM

Command Format: ACKNOWLEDGE_SVC_PROBLEM;<host_name>;<service_description>;<sticky>;<notify>;<persistent>;<author>;<comment>

Description: Allows you to acknowledge the current problem for the specified service. By acknowledging the current problem, future notifications (for the same servicestate) are disabled. If the “sticky” option is set to two (2), the acknowledgement will remain until the service returns to an OK state. Otherwise the acknowledgement will automatically be removed when the service changes state. If the “notify” option is set to one (1), a notification will be sent out to contacts indicating that the current service problem has been acknowledged. If the “persistent” option is set to one (1), the comment associated with the acknowledgement will survive across restarts of the Nagios process. If not, the comment will be deleted the next time Nagios restarts.

Shell Script Usage Example:

#!/bin/sh
# This is a sample shell script showing how you can submit the ACKNOWLEDGE_SVC_PROBLEM 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] ACKNOWLEDGE_SVC_PROBLEM;host1;service1;2;1;1;Some One;Some Acknowledgement Comment\n" $now > $commandfile

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

ADD_SVC_COMMENT

Command Format: ADD_SVC_COMMENT;<host_name>;<service_description>;<persistent>;<author>;<comment>

Description: Adds a comment to a particular service. 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_SVC_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_SVC_COMMENT;host1;service1;1;Some Author;This is a test comment\n" $now > $commandfile

Referencias

manuales/nagios/capacitacion/anexo_-_comandos_externos.txt · Última modificación: 2015/10/16 12:05 por cayu

Herramientas de la página