We've moved to a new support system!

The Nagios Answer Hub is a place where you can get help with technical questions from our experts. There, you can quickly open tickets and join discussion boards.

Request Nagios Answer Hub access here: https://info.nagios.com/answer-hub-access-new-users

After completing the access form, you will be given access to a portal where new tickets can be created. We will keep the old customer forum sections and ticket system available for current cases to be resolved.

Go to the Answer Hub

How External Command or shell script use to disable host chk

Engage with the community of users including those using the open source solutions.
Includes Nagios Core, Plugins, and NCPA

How External Command or shell script use to disable host chk

Postby bvanarse » Wed Oct 06, 2021 7:52 am

How can we write correct code for disable host check for nagios

I used following script, but does not work, also want to add comment while disable the server monitoring


# This is a sample shell script showing how you can submit the DISABLE_HOST_CHECK command
# to Nagios. Adjust variables to fit your environment as necessary.

now=`date +%s`

/bin/printf "[%lu] DISABLE_HOST_CHECK;<host>\n" $now > $commandfile


Please assist
Posts: 1
Joined: Fri Apr 03, 2020 10:38 pm

Re: How External Command or shell script use to disable host

Postby mcapra » Wed Oct 06, 2021 10:45 am

Have you followed these instructions?
https://assets.nagios.com/downloads/nag ... mands.html

In order to have Nagios process external commands, make sure you do the following:
  • Enable external command checking with the check_external_commands option.
  • Specify the location of the command file with the command_file option.
  • Setup proper permissions on the directory containing the external command file, as described in the quickstart guide.

Does your nagios.log file contain any "External command error" messages?
Former Nagios employee
User avatar
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Return to Community Support

Who is online

Users browsing this forum: gormank, rsimnitt and 12 guests