Setup alerts to monitor Dynamic hosts

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
NagiosNoob89
Posts: 4
Joined: Tue Sep 26, 2017 4:14 pm

Setup alerts to monitor Dynamic hosts

Post by NagiosNoob89 »

Hi I was wondering if anyone know how to setup ping tests to Dynamic ips / host names. Currently i've got it setup to monitor static ip addresses but just got a new unit thats dynamic.

host setups I have now:
define host{
use server
host_name testname.test.com
alias test
address 172.xx.xx.xxx ; ip address
}
I was wondering if theres a way to set it up like this:

define host{
use server ; It’s much easier to assign a profile because it will know what to monitor
host_name testcomputer.Test
alias testcomputer
address testcomputer.test
}
bolson

Re: Setup alerts to monitor Dynamic hosts

Post by bolson »

If you have a dynamic dns implementation that should work. And testing should be straightforward enough. Let us know if it works as expected.

Thank you!
NagiosNoob89
Posts: 4
Joined: Tue Sep 26, 2017 4:14 pm

Re: Setup alerts to monitor Dynamic hosts

Post by NagiosNoob89 »

Pretty new at this, not sure if I do. How would I go about checking that
bolson

Re: Setup alerts to monitor Dynamic hosts

Post by bolson »

ping testcomputer and see if it resolves the hostname to an IP address.
dwasswa

Re: Setup alerts to monitor Dynamic hosts

Post by dwasswa »

Thanks at @bolson.

@ NagiosNoob89,in addition,to what @bolson metioned.

The plugin

Code: Select all

check_dns
could also be helpful.

Please see usage below:

Code: Select all

This plugin uses the nslookup program to obtain the IP address for the given host/domain query.
    An optional DNS server to use may be specified.
    If no DNS server is specified, the default server(s) specified in /etc/resolv.conf will be used.


    Usage:
    check_dns -H host [-s server] [-q type ] [-a expected-address] [-A] [-n] [-t timeout] [-w warn] [-c crit]

    Options:
     -h, --help
        Print detailed help screen
     -V, --version
        Print version information
     --extra-opts=[section][@file]
        Read options from an ini file. See
        https://www.nagios-plugins.org/doc/extra-opts.html
        for usage and examples.
     -H, --hostname=HOST
        The name or address you want to query
     -s, --server=HOST
        Optional DNS server you want to use for the lookup
     -q, --querytype=TYPE
        Optional DNS record query type where TYPE =(A, AAAA, SRV, TXT, MX, ANY)
        The default query type is 'A' (IPv4 host entry)
     -a, --expected-address=IP-ADDRESS|HOST
        Optional IP-ADDRESS you expect the DNS server to return. HOST must end with
        a dot (.). This option can be repeated multiple times (Returns OK if any
        value match). If multiple addresses are returned at once, you have to match
        the whole string of addresses separated with commas (sorted alphabetically).
        If you would like to test for the presence of a cname, combine with -n param.
     -A, --expect-authority
        Optionally expect the DNS server to be authoritative for the lookup
     -n, --accept-cname
        Optionally accept cname responses as a valid result to a query
        The default is to ignore cname responses as part of the result
     -w, --warning=seconds
        Return warning if elapsed time exceeds value. Default off
     -c, --critical=seconds
        Return critical if elapsed time exceeds value. Default off
     -t, --timeout=INTEGER:<timeout state>
        Seconds before connection times out (default: 10)
        Optional ":<timeout state>" can be a state integer (0,1,2,3) or a state STRING

    Send email to help@nagios-plugins.org if you have questions regarding use
    of this software. To submit patches or suggest improvements, send email to
    devel@nagios-plugins.org
Please let us know if you have any questions.
User avatar
tacolover101
Posts: 432
Joined: Mon Apr 10, 2017 11:55 am

Re: Setup alerts to monitor Dynamic hosts

Post by tacolover101 »

NagiosNoob89 wrote:Pretty new at this, not sure if I do. How would I go about checking that
how is your dhcp setup? how about DNS? you should look for something similar to this - https://technet.microsoft.com/en-us/lib ... s.11).aspx
dwasswa

Re: Setup alerts to monitor Dynamic hosts

Post by dwasswa »

Locked