Page 1 of 1

Need to monitor check every 2 or 3 seconds

Posted: Thu Apr 03, 2014 12:45 am
by madhudeva
Hi Team..

We had a critical service running and the check runs every one minute to monitor.. I tried 02, 0.2 but it takes 2 minutes. is there any way to add seconds format? ( need to run every 3 seconds )

Regards,
Madhu

Re: Need to monitor check every 2 or 3 seconds

Posted: Thu Apr 03, 2014 11:53 am
by tmcdonald
Before I say this, we *strongly* advise against doing checks every second. That will seriously slow things down. Even if it is just one host or service that is doing this, it is neither easy to set up nor recommended. We aren't just saying this, it really is that bad.

What we would recommend instead is to run a passive check from that host and then only report on a problem from that host. If this is possible I would do this instead.

Re: Need to monitor check every 2 or 3 seconds

Posted: Thu Apr 03, 2014 7:54 pm
by 455157
The passive model does seem like a good idea in this case.

Checking (active) that often, I think the checks could even begin to overlap, where the next check happens before the last check completes- depending on the method/plugin. I wonder how XI responds when that happens.

Could checking this often also hurt the performance of the monitored host, again depending on the specifics?

Re: Need to monitor check every 2 or 3 seconds

Posted: Fri Apr 04, 2014 12:15 am
by madhudeva
I had a custom script as below that checks the SMF services and this is Active check runs every minute as of now.. How do I achieve the same through passive check and where do we mention check time in passive check? If we cannot mention check time how often this passive check monitors the service?
#!/bin/bash

PATH="/usr/bin:/usr/sbin:/bin:/usr/local/bin:/sbin"
LIBEXEC="/markets/nagios/libexec"
. $LIBEXEC/utils.sh

for i in `svcs -o SVC,STATE markets/* | /usr/xpg4/bin/grep -iE "(maintenance)" | awk '{print $1}'| sed 's#site/##g'`;do
mservices=$i" "$mservices
done

if [ "$mservices" = "" ]; then
echo "All services ok"
exit $STATE_OK
else
printf "Service(s) in maintenance: %s\n" "$mservices"
exit $STATE_CRITICAL
fi

Re: Need to monitor check every 2 or 3 seconds

Posted: Fri Apr 04, 2014 12:59 pm
by tmcdonald
Passive checks are pretty easy to set up, you just need to do some reading and a bit of configuration on the remote server:

http://assets.nagios.com/downloads/nagi ... ith_XI.pdf

That doc is the general overview of passive checks using NSCA, and it links to the specific NSCA doc for the remote host. Still with passive checks I would not recommend more than a 1-minute interval even from a passive check.

Re: Need to monitor check every 2 or 3 seconds

Posted: Wed Apr 23, 2014 12:28 am
by clive.dias
Thanks.We will check and get back to you

Re: Need to monitor check every 2 or 3 seconds

Posted: Wed Apr 23, 2014 9:29 am
by tmcdonald
I assume by your emails you guys are from the same organization. We'll keep this thread open until one of you returns.