### Submit START_EXECUTING_SVC_CHECKS via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=41 Example script to write the command to the Nagios command file. Ensure the commandfile path matches your local Nagios installation. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the START_EXECUTING_SVC_CHECKS 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] START_EXECUTING_SVC_CHECKS\n" $now > $commandfile ``` -------------------------------- ### Submit ENABLE_PERFORMANCE_DATA via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=65 Example of writing the command to the Nagios command file using a shell script. Ensure the commandfile path matches your local installation. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the ENABLE_PERFORMANCE_DATA 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] ENABLE_PERFORMANCE_DATA\n" $now > $commandfile ``` -------------------------------- ### Submit START_OBSESSING_OVER_HOST via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=59 Example of writing the command to the Nagios command file using printf. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the START_OBSESSING_OVER_HOST 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] START_OBSESSING_OVER_HOST;host1\n" $now > $commandfile ``` -------------------------------- ### Submit START_ACCEPTING_PASSIVE_HOST_CHECKS via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=69 Example of writing the command to the Nagios command file using a shell script. Ensure the commandfile path matches your specific Nagios installation. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the START_ACCEPTING_PASSIVE_HOST_CHECKS 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] START_ACCEPTING_PASSIVE_HOST_CHECKS\n" $now > $commandfile ``` -------------------------------- ### Submit DISABLE_HOST_FRESHNESS_CHECKS via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=26 Example script demonstrating how to write the command to the Nagios command file. Ensure the commandfile path matches your specific Nagios installation. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the DISABLE_HOST_FRESHNESS_CHECKS 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] DISABLE_HOST_FRESHNESS_CHECKS\n" $now > $commandfile ``` -------------------------------- ### Shell Script Example: Submitting START_ACCEPTING_PASSIVE_SVC_CHECKS Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=43 This shell script demonstrates how to submit the START_ACCEPTING_PASSIVE_SVC_CHECKS command to Nagios Core. Ensure the command file path is correct for your Nagios installation. ```sh #!/bin/sh # This is a sample shell script showing how you can submit the START_ACCEPTING_PASSIVE_SVC_CHECKS 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] START_ACCEPTING_PASSIVE_SVC_CHECKS\n" $now > $commandfile ``` -------------------------------- ### Submit ENABLE_FLAP_DETECTION via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=73 Example of writing the command to the Nagios command file using a shell script. Ensure the commandfile path matches your specific Nagios installation. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the ENABLE_FLAP_DETECTION 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] ENABLE_FLAP_DETECTION\n" $now > $commandfile ``` -------------------------------- ### Submit ENABLE_HOST_AND_CHILD_NOTIFICATIONS via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=19 Example of how to write the command to the Nagios command pipe using a shell script. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the ENABLE_HOST_AND_CHILD_NOTIFICATIONS 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] ENABLE_HOST_AND_CHILD_NOTIFICATIONS;host1\n" $now > $commandfile ``` -------------------------------- ### Submit ENABLE_SERVICEGROUP_HOST_CHECKS via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=97 Example of writing the command to the Nagios command pipe using a shell script. Ensure the commandfile path matches your local Nagios installation. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the ENABLE_SERVICEGROUP_HOST_CHECKS 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] ENABLE_SERVICEGROUP_HOST_CHECKS;servicegroup1\n" $now > $commandfile ``` -------------------------------- ### Submit SCHEDULE_HOSTGROUP_SVC_DOWNTIME via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=124 Example of writing the command to the Nagios command file using a shell script. Ensure the command file path matches your local installation. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the SCHEDULE_HOSTGROUP_SVC_DOWNTIME 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] SCHEDULE_HOSTGROUP_SVC_DOWNTIME;hostgroup1;1110741500;1110748700;0;0;7200;Some One;Some Downtime Comment\n" $now > $commandfile ``` -------------------------------- ### Submit STOP_EXECUTING_SVC_CHECKS via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=42 Example script to write the command to the Nagios command file. Ensure the commandfile path matches your specific Nagios installation. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the STOP_EXECUTING_SVC_CHECKS 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] STOP_EXECUTING_SVC_CHECKS\n" $now > $commandfile ``` -------------------------------- ### Shell Script Example for ENABLE_HOSTGROUP_PASSIVE_HOST_CHECKS Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=87 This shell script demonstrates how to submit the ENABLE_HOSTGROUP_PASSIVE_HOST_CHECKS command to Nagios. Ensure the command file path is correct for your Nagios installation. ```shell #!/bin/sh # This is a sample shell script showing how you can submit the ENABLE_HOSTGROUP_PASSIVE_HOST_CHECKS 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] ENABLE_HOSTGROUP_PASSIVE_HOST_CHECKS;hostgroup1\n" $now > $commandfile ``` -------------------------------- ### Submit ENABLE_HOSTGROUP_HOST_CHECKS via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=85 Example of how to write the command to the Nagios command file using a shell script. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the ENABLE_HOSTGROUP_HOST_CHECKS 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] ENABLE_HOSTGROUP_HOST_CHECKS;hostgroup1\n" $now > $commandfile ``` -------------------------------- ### Submit DEL_ALL_HOST_COMMENTS via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=13 Example of writing the command to the Nagios command file using printf. Ensure the commandfile path matches your local Nagios installation. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the DEL_ALL_HOST_COMMENTS 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] DEL_ALL_HOST_COMMENTS;host1\n" $now > $commandfile ``` -------------------------------- ### Shell Script Example for SCHEDULE_HOST_SVC_DOWNTIME Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=122 This shell script demonstrates how to submit the SCHEDULE_HOST_SVC_DOWNTIME command to Nagios. Adjust the variables to match your environment. The script uses the 'date +%s' command to get the current time in seconds since the UNIX epoch for the start time. ```shell #!/bin/sh # This is a sample shell script showing how you can submit the SCHEDULE_HOST_SVC_DOWNTIME 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] SCHEDULE_HOST_SVC_DOWNTIME;host1;1110741500;1110748700;0;0;7200;Some One;Some Downtime Comment\n" $now > $commandfile ``` -------------------------------- ### Shell Script Example for ENABLE_HOST_NOTIFICATIONS Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=15 This script demonstrates submitting the ENABLE_HOST_NOTIFICATIONS command to Nagios. Adjust the command file path and host name as needed. ```shell #!/bin/sh # This is a sample shell script showing how you can submit the ENABLE_HOST_NOTIFICATIONS 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] ENABLE_HOST_NOTIFICATIONS;host1\n" $now > $commandfile ``` -------------------------------- ### Nagios Core: START_ACCEPTING_PASSIVE_SVC_CHECKS Command Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=43 This is the basic command format for enabling passive service checks on a program-wide basis in Nagios Core. No specific setup or imports are required beyond having Nagios Core installed and configured to accept external commands. ```text START_ACCEPTING_PASSIVE_SVC_CHECKS ``` -------------------------------- ### Shell Script Example for SCHEDULE_AND_PROPAGATE_HOST_DOWNTIME Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=28 This script demonstrates how to submit the SCHEDULE_AND_PROPAGATE_HOST_DOWNTIME command to Nagios. Adjust the variables to match your environment. ```shell #!/bin/sh # This is a sample shell script showing how you can submit the SCHEDULE_AND_PROPAGATE_HOST_DOWNTIME 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] SCHEDULE_AND_PROPAGATE_HOST_DOWNTIME;host1;1110741500;1110748700;0;0;7200;Some One;Some Downtime Comment\n" $now > $commandfile ``` -------------------------------- ### Submit START_OBSESSING_OVER_SVC via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=61 Example of writing the command to the Nagios command file using a shell script. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the START_OBSESSING_OVER_SVC 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] START_OBSESSING_OVER_SVC;host1;service1\n" $now > $commandfile ``` -------------------------------- ### Submit ENABLE_SERVICEGROUP_HOST_NOTIFICATIONS via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=93 Example of writing the command to the Nagios command pipe using a shell script. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the ENABLE_SERVICEGROUP_HOST_NOTIFICATIONS 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] ENABLE_SERVICEGROUP_HOST_NOTIFICATIONS;servicegroup1\n" $now > $commandfile ``` -------------------------------- ### Submit SCHEDULE_HOST_SVC_CHECKS via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=30 Example demonstrating how to write the command to the Nagios command file using a shell script. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the SCHEDULE_HOST_SVC_CHECKS 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] SCHEDULE_HOST_SVC_CHECKS;host1;1110741500\n" $now > $commandfile ``` -------------------------------- ### Shell Script Example for ENABLE_HOSTGROUP_SVC_NOTIFICATIONS Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=79 This script demonstrates how to submit the ENABLE_HOSTGROUP_SVC_NOTIFICATIONS command to Nagios. Ensure the command file path is correct for your environment. ```shell #!/bin/sh # This is a sample shell script showing how you can submit the ENABLE_HOSTGROUP_SVC_NOTIFICATIONS 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] ENABLE_HOSTGROUP_SVC_NOTIFICATIONS;hostgroup1\n" $now > $commandfile ``` -------------------------------- ### Shell Script Example for ENABLE_SVC_FLAP_DETECTION Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=76 This script demonstrates submitting the ENABLE_SVC_FLAP_DETECTION command to Nagios. Adjust the command file path and host/service names as needed for your environment. ```shell #!/bin/sh # This is a sample shell script showing how you can submit the ENABLE_SVC_FLAP_DETECTION 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] ENABLE_SVC_FLAP_DETECTION;host1;service1\n" $now > $commandfile ``` -------------------------------- ### Submit SCHEDULE_FORCED_HOST_SVC_CHECKS via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=130 Example of writing the command to the Nagios command file using printf. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the SCHEDULE_FORCED_HOST_SVC_CHECKS 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] SCHEDULE_FORCED_HOST_SVC_CHECKS;host1;1110741500\n" $now > $commandfile ``` -------------------------------- ### Submit CHANGE_HOST_CHECK_TIMEPERIOD via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=133 Example demonstrating how to write the command to the Nagios command file using a shell script. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the CHANGE_HOST_CHECK_TIMEPERIOD 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] CHANGE_HOST_CHECK_TIMEPERIOD;host1;24x7\n" $now > $commandfile ``` -------------------------------- ### Submit START_OBSESSING_OVER_SVC_CHECKS via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=55 Example of writing the command to the Nagios command file using a shell script. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the START_OBSESSING_OVER_SVC_CHECKS 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] START_OBSESSING_OVER_SVC_CHECKS\n" $now > $commandfile ``` -------------------------------- ### Submit STOP_OBSESSING_OVER_HOST via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=60 Example of writing the command to the Nagios command file using printf. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the STOP_OBSESSING_OVER_HOST 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] STOP_OBSESSING_OVER_HOST;host1\n" $now > $commandfile ``` -------------------------------- ### Shell Script Example for ENABLE_HOST_SVC_NOTIFICATIONS Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=35 This shell script demonstrates how to submit the ENABLE_HOST_SVC_NOTIFICATIONS command to Nagios. Ensure the command file path is correct for your environment. ```shell #!/bin/sh # This is a sample shell script showing how you can submit the ENABLE_HOST_SVC_NOTIFICATIONS 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] ENABLE_HOST_SVC_NOTIFICATIONS;host1\n" $now > $commandfile ``` -------------------------------- ### Submit STOP_ACCEPTING_PASSIVE_SVC_CHECKS via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=44 Example script demonstrating how to write the command to the Nagios command file. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the STOP_ACCEPTING_PASSIVE_SVC_CHECKS 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] STOP_ACCEPTING_PASSIVE_SVC_CHECKS\n" $now > $commandfile ``` -------------------------------- ### Submit CHANGE_CONTACT_HOST_NOTIFICATION_TIMEPERIOD via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=153 Example demonstrating how to write the command to the Nagios command pipe using printf. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the CHANGE_CONTACT_HOST_NOTIFICATION_TIMEPERIOD 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] CHANGE_CONTACT_HOST_NOTIFICATION_TIMEPERIOD;contact1;24x7\n" $now > $commandfile ``` -------------------------------- ### Shell Script Example for ENABLE_HOST_SVC_CHECKS Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=33 This shell script demonstrates how to send the ENABLE_HOST_SVC_CHECKS command to Nagios. Ensure the command file path is correct for your environment. ```shell #!/bin/sh # This is a sample shell script showing how you can submit the ENABLE_HOST_SVC_CHECKS 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] ENABLE_HOST_SVC_CHECKS;host1\n" $now > $commandfile ``` -------------------------------- ### Submit CHANGE_CUSTOM_HOST_VAR via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=139 Example of how to write the command to the Nagios command file using a shell script. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the CHANGE_CUSTOM_HOST_VAR 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] CHANGE_CUSTOM_HOST_VAR;host1;SOMEVAR;SOMEVALUE\n" $now > $commandfile ``` -------------------------------- ### Submit DISABLE_HOSTGROUP_SVC_CHECKS via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=84 Example of writing the command to the Nagios command file using printf. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the DISABLE_HOSTGROUP_SVC_CHECKS 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] DISABLE_HOSTGROUP_SVC_CHECKS;hostgroup1\n" $now > $commandfile ``` -------------------------------- ### Submit DISABLE_PASSIVE_HOST_CHECKS via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=72 Example script demonstrating how to write the command to the Nagios command file. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the DISABLE_PASSIVE_HOST_CHECKS 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] DISABLE_PASSIVE_HOST_CHECKS;host1\n" $now > $commandfile ``` -------------------------------- ### Submit ENABLE_PASSIVE_SVC_CHECKS via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=45 Example of how to write the command to the Nagios command file using a shell script. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the ENABLE_PASSIVE_SVC_CHECKS 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] ENABLE_PASSIVE_SVC_CHECKS;host1;service1\n" $now > $commandfile ``` -------------------------------- ### Submit CHANGE_SVC_CHECK_TIMEPERIOD via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=137 Example demonstrating how to write the command to the Nagios command pipe using printf. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the CHANGE_SVC_CHECK_TIMEPERIOD 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] CHANGE_SVC_CHECK_TIMEPERIOD;host1;service1;24x7\n" $now > $commandfile ``` -------------------------------- ### Submit SCHEDULE_SVC_DOWNTIME via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=119 Example demonstrating how to write the command to the Nagios command file using a shell script. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the SCHEDULE_SVC_DOWNTIME 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] SCHEDULE_SVC_DOWNTIME;host1;service1;1110741500;1110748700;0;0;7200;Some One;Some Downtime Comment\n" $now > $commandfile ``` -------------------------------- ### Shell Script Example for ENABLE_HOST_FRESHNESS_CHECKS Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=24 This shell script demonstrates how to submit the ENABLE_HOST_FRESHNESS_CHECKS command to Nagios. Ensure the command file path and variables are adjusted for your environment. ```sh #!/bin/sh # This is a sample shell script showing how you can submit the ENABLE_HOST_FRESHNESS_CHECKS 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] ENABLE_HOST_FRESHNESS_CHECKS\n" $now > $commandfile ``` -------------------------------- ### Shell Script Example for ENABLE_EVENT_HANDLERS Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=47 This shell script demonstrates how to submit the ENABLE_EVENT_HANDLERS command to Nagios Core. Ensure the command file path is adjusted to your environment. ```shell #!/bin/sh # This is a sample shell script showing how you can submit the ENABLE_EVENT_HANDLERS 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] ENABLE_EVENT_HANDLERS\n" $now > $commandfile ``` -------------------------------- ### Submit DISABLE_HOST_FLAP_DETECTION via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=77 Example of how to write the command to the Nagios command file using a shell script. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the DISABLE_HOST_FLAP_DETECTION 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] DISABLE_HOST_FLAP_DETECTION;host1\n" $now > $commandfile ``` -------------------------------- ### Submit READ_STATE_INFORMATION via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=32 Example of writing the command to the Nagios command pipe using a shell script. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the READ_STATE_INFORMATION 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] READ_STATE_INFORMATION\n" $now > $commandfile ``` -------------------------------- ### Submit DELAY_SVC_NOTIFICATION via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=37 Example demonstrating how to write the command to the Nagios command pipe using a shell script. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the DELAY_SVC_NOTIFICATION 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] DELAY_SVC_NOTIFICATION;host1;service1;1110741500\n" $now > $commandfile ``` -------------------------------- ### Submit CHANGE_SVC_EVENT_HANDLER via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=106 Example demonstrating how to write the command to the Nagios command pipe using a shell script. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the CHANGE_SVC_EVENT_HANDLER 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] CHANGE_SVC_EVENT_HANDLER;host1;service1;neweventhandlercmd\n" $now > $commandfile ``` -------------------------------- ### Shell Script Example for START_OBSESSING_OVER_HOST_CHECKS Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=57 This shell script demonstrates how to submit the START_OBSESSING_OVER_HOST_CHECKS command to Nagios. Ensure the command file path is correct for your environment. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the START_OBSESSING_OVER_HOST_CHECKS 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] START_OBSESSING_OVER_HOST_CHECKS\n" $now > $commandfile ``` -------------------------------- ### Submit SEND_CUSTOM_SVC_NOTIFICATION via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=135 Example demonstrating how to write the command to the Nagios command pipe using a shell script. ```bash #!/bin/sh # 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` commandfile='/usr/local/nagios/var/rw/nagios.cmd' /bin/printf "[%lu] SEND_CUSTOM_SVC_NOTIFICATION;envirosensor;Water Level;3;Ethan;The NOC is currently flooding. Help!\n" $now > $commandfile ``` -------------------------------- ### Submit ENABLE_CONTACTGROUP_SVC_NOTIFICATIONS via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=148 Example of writing the command to the Nagios command file using a shell script. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the ENABLE_CONTACTGROUP_SVC_NOTIFICATIONS 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] ENABLE_CONTACTGROUP_SVC_NOTIFICATIONS;linux-admins\n" $now > $commandfile ``` -------------------------------- ### Shell Script Example for SCHEDULE_FORCED_HOST_CHECK Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=128 A sample shell script demonstrating how to submit the SCHEDULE_FORCED_HOST_CHECK command to Nagios. Ensure the command file path is adjusted for your environment. ```shell #!/bin/sh # This is a sample shell script showing how you can submit the SCHEDULE_FORCED_HOST_CHECK 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] SCHEDULE_FORCED_HOST_CHECK;host1;1110741500\n" $now > $commandfile ``` -------------------------------- ### Submit ENABLE_HOST_EVENT_HANDLER via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=49 Example of how to programmatically submit the command to the Nagios command pipe using a shell script. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the ENABLE_HOST_EVENT_HANDLER 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] ENABLE_HOST_EVENT_HANDLER;host1\n" $now > $commandfile ``` -------------------------------- ### Submit ENABLE_SVC_CHECK via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=5 Example of how to programmatically submit the command to the Nagios command pipe using a shell script. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the ENABLE_SVC_CHECK 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] ENABLE_SVC_CHECK;host1;service1\n" $now > $commandfile ``` -------------------------------- ### Submit CHANGE_GLOBAL_HOST_EVENT_HANDLER via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=103 Example of writing the command to the Nagios command pipe using a shell script. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the CHANGE_GLOBAL_HOST_EVENT_HANDLER 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] CHANGE_GLOBAL_HOST_EVENT_HANDLER;neweventhandlercmd\n" $now > $commandfile ``` -------------------------------- ### Submit CHANGE_HOST_EVENT_HANDLER via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=105 Example of writing the command to the Nagios command pipe using a shell script. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the CHANGE_HOST_EVENT_HANDLER 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] CHANGE_HOST_EVENT_HANDLER;host1;neweventhandlercmd\n" $now > $commandfile ``` -------------------------------- ### Shell Script Example for SCHEDULE_SVC_CHECK Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=29 This shell script demonstrates how to submit the SCHEDULE_SVC_CHECK command to Nagios. It dynamically gets the current time and writes the command to the Nagios command file. Adjust the command file path as needed for your Nagios installation. ```shell #!/bin/sh # This is a sample shell script showing how you can submit the SCHEDULE_SVC_CHECK 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] SCHEDULE_SVC_CHECK;host1;service1;1110741500\n" $now > $commandfile ``` -------------------------------- ### Submit DISABLE_HOST_SVC_NOTIFICATIONS via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=36 Example of how to write the command to the Nagios command file using a shell script. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the DISABLE_HOST_SVC_NOTIFICATIONS 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] DISABLE_HOST_SVC_NOTIFICATIONS;host1\n" $now > $commandfile ``` -------------------------------- ### Submit DISABLE_SERVICE_FRESHNESS_CHECKS via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=25 Example of how to write the command to the Nagios command file using a shell script. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the DISABLE_SERVICE_FRESHNESS_CHECKS 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] DISABLE_SERVICE_FRESHNESS_CHECKS\n" $now > $commandfile ``` -------------------------------- ### Submit CHANGE_MAX_SVC_CHECK_ATTEMPTS via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=113 Example demonstrating how to write the command to the Nagios command pipe using a shell script. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the CHANGE_MAX_SVC_CHECK_ATTEMPTS 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] CHANGE_MAX_SVC_CHECK_ATTEMPTS;host1;service1;5\n" $now > $commandfile ``` -------------------------------- ### Submit CHANGE_GLOBAL_SVC_EVENT_HANDLER via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=104 Example of writing the command to the Nagios command pipe using a shell script. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the CHANGE_GLOBAL_SVC_EVENT_HANDLER 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] CHANGE_GLOBAL_SVC_EVENT_HANDLER;neweventhandlercmd\n" $now > $commandfile ``` -------------------------------- ### Submit SCHEDULE_HOSTGROUP_HOST_DOWNTIME via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=123 Example of writing the command to the Nagios command file using a shell script. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the SCHEDULE_HOSTGROUP_HOST_DOWNTIME 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] SCHEDULE_HOSTGROUP_HOST_DOWNTIME;hostgroup1;1110741500;1110748700;0;0;7200;Some One;Some Downtime Comment\n" $now > $commandfile ``` -------------------------------- ### Submit ENABLE_ALL_NOTIFICATIONS_BEYOND_HOST via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=17 A sample shell script demonstrating how to write the command to the Nagios command pipe. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the ENABLE_ALL_NOTIFICATIONS_BEYOND_HOST 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] ENABLE_ALL_NOTIFICATIONS_BEYOND_HOST;host1\n" $now > $commandfile ``` -------------------------------- ### Submit CHANGE_RETRY_HOST_CHECK_INTERVAL via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=136 Example of how to write the command to the Nagios command pipe using a shell script. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the CHANGE_RETRY_HOST_CHECK_INTERVAL 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] CHANGE_RETRY_HOST_CHECK_INTERVAL;host1;5\n" $now > $commandfile ``` -------------------------------- ### Submit ENABLE_SERVICEGROUP_PASSIVE_HOST_CHECKS via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=101 Example of how to write the command to the Nagios command pipe using a shell script. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the ENABLE_SERVICEGROUP_PASSIVE_HOST_CHECKS 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] ENABLE_SERVICEGROUP_PASSIVE_HOST_CHECKS;servicegroup1\n" $now > $commandfile ``` -------------------------------- ### Submit DISABLE_HOSTGROUP_SVC_NOTIFICATIONS via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=80 Example demonstrating how to write the command to the Nagios command pipe using a shell script. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the DISABLE_HOSTGROUP_SVC_NOTIFICATIONS 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] DISABLE_HOSTGROUP_SVC_NOTIFICATIONS;hostgroup1\n" $now > $commandfile ``` -------------------------------- ### Shell Script Example for ACKNOWLEDGE_HOST_PROBLEM Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=39 This shell script demonstrates how to submit the ACKNOWLEDGE_HOST_PROBLEM command to Nagios. Adjust the command file path and parameters to match your environment. ```shell #!/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 ``` -------------------------------- ### Shell Script Example for CHANGE_HOST_CHECK_COMMAND Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=107 This shell script demonstrates how to submit the CHANGE_HOST_CHECK_COMMAND to Nagios. Adjust the command file path and variables for your environment. ```shell #!/bin/sh # This is a sample shell script showing how you can submit the CHANGE_HOST_CHECK_COMMAND 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] CHANGE_HOST_CHECK_COMMAND;host1;newcheckcmd\n" $now > $commandfile ``` -------------------------------- ### Submit CHANGE_NORMAL_SVC_CHECK_INTERVAL via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=110 Example demonstrating how to write the command to the Nagios command pipe using a shell script. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the CHANGE_NORMAL_SVC_CHECK_INTERVAL 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] CHANGE_NORMAL_SVC_CHECK_INTERVAL;host1;service1;15\n" $now > $commandfile ``` -------------------------------- ### Shell Script Example for ENABLE_HOST_FLAP_DETECTION Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=75 A sample shell script demonstrating how to send the ENABLE_HOST_FLAP_DETECTION command to Nagios. This script constructs the command with a timestamp and writes it to the Nagios command file. ```shell #!/bin/sh # This is a sample shell script showing how you can submit the ENABLE_HOST_FLAP_DETECTION 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] ENABLE_HOST_FLAP_DETECTION;host1\n" $now > $commandfile ``` -------------------------------- ### Shell Script Example for ENABLE_FAILURE_PREDICTION Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=63 This shell script demonstrates how to submit the ENABLE_FAILURE_PREDICTION command to Nagios. Ensure the command file path is adjusted for your environment. ```shell #!/bin/sh # This is a sample shell script showing how you can submit the ENABLE_FAILURE_PREDICTION 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] ENABLE_FAILURE_PREDICTION\n" $now > $commandfile ``` -------------------------------- ### Submit ENABLE_SERVICE_FRESHNESS_CHECKS via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=23 A sample shell script demonstrating how to write the command to the Nagios command file. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the ENABLE_SERVICE_FRESHNESS_CHECKS 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] ENABLE_SERVICE_FRESHNESS_CHECKS\n" $now > $commandfile ``` -------------------------------- ### Submit PROCESS_FILE via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=131 Example of writing the PROCESS_FILE command to the Nagios command pipe using a shell script. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the PROCESS_FILE 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] PROCESS_FILE;/usr/local/nagios/libexec/morecommands.cmd;0\n" $now > $commandfile ``` -------------------------------- ### Submit CHANGE_SVC_CHECK_COMMAND via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=108 Example of how to write the command to the Nagios command file using a shell script. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the CHANGE_SVC_CHECK_COMMAND 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] CHANGE_SVC_CHECK_COMMAND;host1;service1;newcheckcmd\n" $now > $commandfile ``` -------------------------------- ### Shell Script Example for ENABLE_SVC_NOTIFICATIONS Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=11 This script demonstrates how to submit the ENABLE_SVC_NOTIFICATIONS command to Nagios Core. Adjust the command file path and host/service names as needed for your environment. ```shell #!/bin/sh # This is a sample shell script showing how you can submit the ENABLE_SVC_NOTIFICATIONS 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] ENABLE_SVC_NOTIFICATIONS;host1;service1\n" $now > $commandfile ``` -------------------------------- ### Shell Script Example for ADD_SVC_COMMENT Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=2 This script demonstrates how to submit the ADD_SVC_COMMENT command to Nagios. Adjust the command file path and variables to match your environment. ```shell #!/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 ``` -------------------------------- ### Shell Script Example for ENABLE_HOST_CHECK Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=53 This script demonstrates how to send the ENABLE_HOST_CHECK command to Nagios Core. Adjust the command file path and host name as needed for your environment. ```shell #!/bin/sh # This is a sample shell script showing how you can submit the ENABLE_HOST_CHECK 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] ENABLE_HOST_CHECK;host1\n" $now > $commandfile ``` -------------------------------- ### Submit STOP_OBSESSING_OVER_HOST_CHECKS via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=58 Example of writing the command to the Nagios command file using a shell script. Ensure the commandfile path matches your specific Nagios installation. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the STOP_OBSESSING_OVER_HOST_CHECKS 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] STOP_OBSESSING_OVER_HOST_CHECKS\n" $now > $commandfile ``` -------------------------------- ### Shell Script Example for SEND_CUSTOM_HOST_NOTIFICATION Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=134 This shell script demonstrates how to submit the SEND_CUSTOM_HOST_NOTIFICATION command to Nagios. Ensure the command file path and variables are adjusted for your environment. ```shell #!/bin/sh # This is a sample shell script showing how you can submit the SEND_CUSTOM_HOST_NOTIFICATION 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] SEND_CUSTOM_HOST_NOTIFICATION;router;3;Ethan;I'm trapped in the NOC - help! BTW, is it normal for smoke to be coming from the router?!?\n" $now > $commandfile ``` -------------------------------- ### Shell Script Example for CHANGE_SVC_NOTIFICATION_TIMEPERIOD Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=151 Example of a shell script to submit the CHANGE_SVC_NOTIFICATION_TIMEPERIOD command to Nagios. Adjust the command file path and variables as needed for your environment. ```shell #!/bin/sh # This is a sample shell script showing how you can submit the CHANGE_SVC_NOTIFICATION_TIMEPERIOD 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] CHANGE_SVC_NOTIFICATION_TIMEPERIOD;host1;service1;24x7\n" $now > $commandfile ``` -------------------------------- ### START_EXECUTING_SVC_CHECKS Command Format Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=41 The raw command string used to enable active service checks. ```text START_EXECUTING_SVC_CHECKS ``` -------------------------------- ### Submit ENABLE_HOSTGROUP_SVC_CHECKS via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=83 A sample shell script demonstrating how to write the command to the Nagios command pipe. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the ENABLE_HOSTGROUP_SVC_CHECKS 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] ENABLE_HOSTGROUP_SVC_CHECKS;hostgroup1\n" $now > $commandfile ``` -------------------------------- ### Submit ENABLE_SVC_EVENT_HANDLER via Shell Script Source: https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=51 A sample shell script demonstrating how to write the command to the Nagios command pipe. ```bash #!/bin/sh # This is a sample shell script showing how you can submit the ENABLE_SVC_EVENT_HANDLER 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] ENABLE_SVC_EVENT_HANDLER;host1;service1\n" $now > $commandfile ```