using fping to find missing A records

Tom Throckmorton throck at duke.edu
Thu Feb 14 04:26:34 CET 2008


On Feb 13 18:05, Roger wrote:
> I have a specific question on how to do something, and a larger question
> addressing other "better" ways to do the spirit of what I'm asking.
> 
> I'm setting up Nagios, and am trying to make sure that all of the subnets
> have A records, as IP addresses will be changing very, very rapidly, and
> when that day comes, I will not be here (but on another Nagios project).
> 
> So, I'd like to create A records for each host.

...so, are you trying to make sure that for every name you have an A record, or
for every A you have a PTR (i.e. a name that corresponds to the numeric)?  It
sounds like the latter, since you're thinking of doing this by looking at
numbers...

> How do I "fping -a" a range
> of IP addresses, strip out the names of the name that the host replies with,
> and then ping that list of names?  (You don't have to tell me how exactly, a
> general idea of which command line tools will do)
> 
> I'm thinking something like: fping -g 192.168.1.0 192.168.1.255 -A | grep
> whatever > file, and then shove that file in another fping statement.

If I understand correctly what you're shooting for, it can be done in one step:

you at yourhost% fping -ang 192.168.1.0/24

...would return

- all hosts that are alive
- by name (if one exists)
- for a generated range (192.168.1.0..192.168.1.255)

If you want to only show hosts for which there is no PTR record, just 'grep -v'
your target domain(s) from the output.

-tt

p.s.  Hopefully, none of those hosts in that range are blocking your pings :)

-- 
Tom Throckmorton
OIT - CSI
Duke University

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list