Well, you'll have to mix and match whatever your solution is until Log Server has some sort of alert time settings. Good luck!
You could also have NLS use the "Execute Script" alert mechanism and have it determine whether or not to send something via NRDP. If that's what you're after, that would be pretty trivial.
enable / disable an alert on a schedule?
Re: enable / disable an alert on a schedule?
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
Re: enable / disable an alert on a schedule?
It wouldn't be too difficult. Have it execute a script, check the current time, and forward on to execute another script as needed if the time is within x defined time period.eloyd wrote:Well, you'll have to mix and match whatever your solution is until Log Server has some sort of alert time settings. Good luck!
You could also have NLS use the "Execute Script" alert mechanism and have it determine whether or not to send something via NRDP. If that's what you're after, that would be pretty trivial.
Former Nagios Employee
Re: enable / disable an alert on a schedule?
The following is likely not to work, as it's just off the top of my head. Create a file called something memorable (such as /usr/local/bin/notify.sh):
Now go create an alert that uses "Execute Script" as the type "/path/to/notify.sh" from above. Set the arguments to be:
And poof, you're done.
Code: Select all
#!/bin/sh
# We're passing in parameters as: %count% %status% "%output%"
count="$1"
status="$2"
output="$3"
# These need to change:
nagiosXI="http://nagios.server.com/nrdp/"
token="MyNRDPtoken"
host="hostname"
service="servicename"
do_alert() {
/usr/local/nrdp/clients/send_nrdp.php --url=http://${nagiosXI} --token=${token} --host="${host}" --service="${service}" --state="${status}" --output="${output}"
}
# Need to convert text to Nagios result codes
case "$status" in
ok) status=0;;
warning) status=1;;
critical) status=2;;
*) status=3;;
esac
# Figure out if it's a weekend or not
dayOfWeek=`date +%a`
case "$dayOfWeek" in
Mon|Tue|Wed|Thu|Fri) do_alert;;
Sat|Sun) exit;;
esac
Code: Select all
%count% %status% "%output%"
Last edited by eloyd on Tue Jun 28, 2016 1:08 pm, edited 1 time in total.
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
Re: enable / disable an alert on a schedule?
*poof*
@Jklre - let us know if you have any further questions.
@Jklre - let us know if you have any further questions.
Former Nagios Employee
Re: enable / disable an alert on a schedule?
I forgot to say "easy peasy lemon squeezy." 
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
Re: enable / disable an alert on a schedule?
eloyd wrote:I forgot to say "easy peasy lemon squeezy."
This would definitely be a creative solution I will look into. Right now I have the re-occurring downtime set and hopefully that will prevent this alert from firing and me being woken up on the weekends
Re: enable / disable an alert on a schedule?
Sounds good - we'll let @eloyd say "easy peasy lemon squeezy." after it works! 
Leaving this open for now, let us know how the testing goes!
Leaving this open for now, let us know how the testing goes!
Former Nagios Employee