Solved

Nagios run command at intervals

Posted on 2014-03-12
2
572 Views
Last Modified: 2014-03-20
Hi Experts,

We have a check_whois.pl script running via Nagios which we would like to implement on our servers, this does a whois of the registrar.

The issue we have is that the AuDA who look after the com.au domains only allow 20 queries per hour and 100 queries per day.

Is there a way to set up this script for 350 of our domains to only check 95 times spread out within 24 hours? (around every 15 minutes)
It will take just over 3 and a half days to go through all our domains, then we would like it to start again.

Any ideas?

Thanks
0
Comment
Question by:bossagroup
2 Comments
 
LVL 13

Accepted Solution

by:
Daniel Helgenberger earned 500 total points
ID: 39925868
In nagios, a service check can only be fully done or is not done at all.

I had a look at the check_whois.pl and suppose you did setup evey single domain to check as a single service? I can only assume some things, and without further details it is hard to come up with a comprehensive answer.

To overcome the limit of 20 checks per hour I see several approaches, depending on your setup. I also suppose that whois checks suffice to be checked once a day. Also, you would have to make sure nobody else on your network is using whois but nagios. Configure your firewall accordingly.

1. Certainly the easiest way, you can use it with your currently defined services, are time periods. 100 checks per day is the more reasonable limit to define. If you want to keep it simple, define service checks every two hours or so and even manually reschedule some checks the first time. Also I would set the service to do no rechecks but fail hard (or recheck every hour).
Define 7 check periods (one for every each day of the week) and assign 50 of your existing services/domains to each check period. This way you still may have more than 20 checks per hour, but the chance might be reasonably low.
http://nagios.sourceforge.net/docs/nagioscore/3/en/timeperiods.html

2. Do use a text file / database search as input to check_whois.pl; containing only 20 domains each. Put a shell script wrapper around check_whois.pl. This way you can configure 20 domains as one service and check it only one per day. You would still need check periods to make sure you have no race conditions.

3. The cleanest way: Write your own plugin, use the existing check_whois.pl as base. There, add a counter in a temp file incrementing every time the scripts runs; returning OK when it reaches 20 / 100 and do actual checks if the number is below 20 / 100. Reset it every hour/day. There you would need to make sure they are indeed checked in order.

4. Outside nagios: If you can influence source IP of nagios' whois check, then you can just add a rule on your firewall. Remember, you have 20 checks per hour from every public IP you 'own'.
0
 

Author Closing Comment

by:bossagroup
ID: 39943917
Thanks for the detailed reply
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is in response to a question (http://www.experts-exchange.com/Networking/Network_Management/Network_Analysis/Q_28230497.html) here at Experts Exchange. The Original Poster (OP) requires a utility that will accept a list of IP addresses …
How to set-up an On Demand, IPSec, Site to SIte, VPN from a Draytek Vigor Router to a Cyberoam UTM Appliance. A concise guide to the settings required on both devices
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question