Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Nagios run command at intervals

Posted on 2014-03-12
2
Medium Priority
?
682 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 2000 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

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.
The use of stolen credentials is a hot commodity this year allowing threat actors to move laterally within the network in order to avoid breach detection.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Suggested Courses

618 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