Solved

Nagios run command at intervals

Posted on 2014-03-12
2
546 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Quality of Service (QoS) options are nearly endless when it comes to networks today. This article is merely one example of how it can be handled in a hub-n-spoke design using a 3-tier configuration.
PRTG Network Monitor lets you monitor your bandwidth usage, so you know who is using up your bandwidth, and what they're using it for.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

758 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now