Firstly thank you for all your help.
I was wondering if you cold assist with the following please?
I happy with the Group or Local Policy aspect of the process.
I am struggling with the script aspect. For instance, assuming I am using a Local Policy.
If I create a script called
DISABLE_NOTIFICATIONS.
What file extension should I use i.e. .cmd or bat?
#!/bin/sh
# This is a sample shell script showing how you can submit the DISABLE_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_NOTIFICATIONS\n" $now > $commandfile
Do I need to copy the script and place it in the folder C:\Program Files\NSClient++\Scripts
Then update the file C:\Program Files\NSClient++\nsclient.ini
Under the header [/settings/external scripts/scripts]
DISABLE_NOTIFICATIONS.bat = scripts\\DISABLE_NOTIFICATIONS.bat $ARG1$ "$ARG2$"
I am not sure what the variables $ARG1$ "$ARG2$ should be set to, can you please advise?
Apologies if I have misunderstood your advice I am still new to Nagios and this is my first attempt at a script. I am more Next, Next, Next, Finish.
The overall goal is stop any alerts whilst the server is powered off line and then to continue monitoring when the server is back on line.
The scripts I was thinking about using are
Server Shutdown Script:
https://assets.nagios.com/downloads/nag ... mand_id=54
Server Startup Script:
https://assets.nagios.com/downloads/nag ... mand_id=53
I did have a look at the article below but it didn't make a great deal of sense.
http://YOURXISERVER//nagiosxi/help/api- ... portconfig