Setup alerts to monitor Dynamic hosts

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

Setup alerts to monitor Dynamic hosts

Postby NagiosNoob89 » Tue Oct 10, 2017 2:19 pm

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
}
NagiosNoob89
 
Posts: 4
Joined: Tue Sep 26, 2017 4:14 pm

Re: Setup alerts to monitor Dynamic hosts

Postby bolson » Tue Oct 10, 2017 2:33 pm

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!
Brian Olson
Nagios Support Team
---
Nagios Enterprises, LLC
Email: customersupport@nagios.com
Web: https://www.nagios.com/
User avatar
bolson
Support Tech
 
Posts: 595
Joined: Tue Jul 11, 2017 10:34 am

Re: Setup alerts to monitor Dynamic hosts

Postby NagiosNoob89 » Tue Oct 10, 2017 2:35 pm

Pretty new at this, not sure if I do. How would I go about checking that
NagiosNoob89
 
Posts: 4
Joined: Tue Sep 26, 2017 4:14 pm

Re: Setup alerts to monitor Dynamic hosts

Postby bolson » Tue Oct 10, 2017 2:36 pm

ping testcomputer and see if it resolves the hostname to an IP address.
Brian Olson
Nagios Support Team
---
Nagios Enterprises, LLC
Email: customersupport@nagios.com
Web: https://www.nagios.com/
User avatar
bolson
Support Tech
 
Posts: 595
Joined: Tue Jul 11, 2017 10:34 am

Re: Setup alerts to monitor Dynamic hosts

Postby dwasswa » Tue Oct 10, 2017 2:55 pm

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
dwasswa
 
Posts: 222
Joined: Tue Jul 25, 2017 3:32 pm

Re: Setup alerts to monitor Dynamic hosts

Postby tacolover101 » Wed Oct 11, 2017 12:45 am

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 ... 14(v=ws.11).aspx
User avatar
tacolover101
 
Posts: 288
Joined: Mon Apr 10, 2017 11:55 am

Re: Setup alerts to monitor Dynamic hosts

Postby dwasswa » Wed Oct 11, 2017 1:19 pm

User avatar
dwasswa
 
Posts: 222
Joined: Tue Jul 25, 2017 3:32 pm


Return to Nagios Core

Who is online

Users browsing this forum: No registered users and 24 guests