Solved

Nagios run command at intervals

Posted on 2014-03-12
2
589 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

The purpose of this article is to demonstrate how we can use conditional statements using Python.
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.
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…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

730 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