DNS

check_dyndns

Description:

Check-Plugin to verify an address registered with dyndns.org (and optionally to update the registered address upon detecting a mismatch!)

Current Version

Last Release Date

February 4, 2010

Compatible With


Project Files
Project Notes
This plugin determines the current external address (by checking with checkip.dyndns.org). Then it finds the address known to DNS. If they do not match, there are two possibilites: 1. Just report the problem (as CRITICAL) 2. Correct the problem (if credentials to do so are given) and return as WARNING state. Dyndns says not to query their checkip-host more often than every ten minutes, therefore a cache file is used to store the last known result and a new query is only done, if the ten minutes have passed (very useful, if you have multiple hostnames registered with dyndns - otherwise just increase the check_interval in nagios). - Usage: check_dyndns host-to-check [dyndns-credentials] - host-to-check - is the host (e.g. mylovelyhost@dyndns.org) - dyndns-credentials - if present, use these to update the address (format: user:password) Notes: * DO NOT put the credentials in the object descriptions or commands! Consider using a $USERxx$ macro for this purpose. * If using a proxy server to access the internet, you can set it in the script at the very beginning (CurlHttpProxy=) * The location of the cache-file can also be changed there (LastCheckFile=)
Reviews (3) Add a Review
The [[ error…
by BlackJack, March 31, 2013

…can be resolved by replacing `sh` by `bash` in the first line, because [[ is Bash syntax but `sh` may point to a different shell.



Not working for me
by leb0rtran, February 28, 2013

hi, i get the following error if i try the script as root user: root@...:/usr/lib/nagios/plugins# ./check_dyndns mydomain@dyndns.org ./check_dyndns: 112: [[: not found ./check_dyndns: 112: [[: not found ./check_dyndns: 112: [[: not found ./check_dyndns: 112: [[: not found cat: /var/cache/nagios/check_dyndnsip.last: Datei oder Verzeichnis nicht gefunden ./check_dyndns: 112: [[: not found ./check_dyndns: 112: [[: not found INTERNAL ERROR: Status code not properly set! [cache: no file] [query: no] if i create the directory /var/cache/nagios/ and empty file /var/cache/nagios/check_dyndnsip.last, the following error appears: root@...:/usr/lib/nagios/plugins# ./check_dyndns ...@dyndns.org ./check_dyndns: 112: [[: not found ./check_dyndns: 112: [[: not found ./check_dyndns: 112: [[: not found ./check_dyndns: 112: [[: not found ./check_dyndns: 112: [[: not found ./check_dyndns: 112: [[: not found INTERNAL ERROR: Status code not properly set! [cache: no file] [query: no]



modify to use specific DNS server for host-query...
by svg, May 31, 2012

Hi, thanks for your good script. this helped me to code it myself. Thanks! i did some small modification to use a specific DNS as if you run such script behind your dyndns router and the router is a DNS server itself it could not resolve the "wrong" dns... so the Host query section needs a external DNS server. What i did? added in the parameters section this: CurlHttpProxy= DNSServer2use= and in line 74 this: HostResult=`host $DdnsHost $DNSServer2use` now you simply put the IP of a external DNS server into the variable and "host" will use this to place the query to find "definedIP". again: thanks for your good script! cheers Stephan



Add a Review

You must be logged in to submit a review.

Thank you for your review!

Your review has been submitted and is pending approval.

Recommend

To:


From:


Thank you for your recommendation!

Your recommendation has been sent.

Project Stats
Rating
3.8 (4)
Favorites
0
Views
159,828