Need to monitor check every 2 or 3 seconds

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
madhudeva
Posts: 32
Joined: Thu Jun 20, 2013 1:08 am

Need to monitor check every 2 or 3 seconds

Post 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
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Need to monitor check every 2 or 3 seconds

Post 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.
Former Nagios employee
455157
Posts: 50
Joined: Mon Sep 10, 2012 7:35 pm

Re: Need to monitor check every 2 or 3 seconds

Post 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?
madhudeva
Posts: 32
Joined: Thu Jun 20, 2013 1:08 am

Re: Need to monitor check every 2 or 3 seconds

Post 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
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Need to monitor check every 2 or 3 seconds

Post 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.
Former Nagios employee
clive.dias
Posts: 21
Joined: Fri Jun 07, 2013 3:36 am

Re: Need to monitor check every 2 or 3 seconds

Post by clive.dias »

Thanks.We will check and get back to you
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Need to monitor check every 2 or 3 seconds

Post 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.
Former Nagios employee
Locked