Solved

Nagios run command at intervals

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Transparency shows that a company is the kind of business that it wants people to think it is.
Use of TCL script on Cisco devices:  - create file and merge it with running configuration to apply configuration changes
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
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.

911 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

16 Experts available now in Live!

Get 1:1 Help Now