check_nrpe problem with dynamic ip

J. Bakshi joydeep at infoservices.in
Mon Sep 1 12:55:43 CEST 2008


Assaf Flatto wrote:
> you can write a simple script that query the new dns/ip address of the nagios 
>
>  ping nagios.foo.com |head -1 | awk '{print $3}' |tr -d '(' ')'
>
> this will give the ip ,take the ip and replace that in the nrpe.cfg 
>
> and run the script in the cron every 2 days to make sure it gets the new ip .
>   

Hi Assaf,

I am afraid to say, but i can't understand its utility.
how this script help the remote nrpe daemon a.k.a  "/etc/nagios/nrpe.cfg"
to know the IP of my local machine ? The "allowed_hosts" needs to know the
IP of my local machine so that I can use nrpe_check command from my
local machine.

many thanks

> Assaf
>
> On Monday 01 September 2008 10:20:32 J. Bakshi wrote:
>   
>> Assaf Flatto wrote:
>>     
>>> On Monday 01 September 2008 09:57:30 J. Bakshi wrote:
>>>       
>>>> Hello All,
>>>>
>>>> The remote server where I have installed nrpe, the /etc/nagios/nrpe.cfg
>>>> has allowed_hosts=127.0.0.1,122.161.137.217
>>>>
>>>> 122.161.137.217 is the IP of my local nagios monitoring machine.
>>>> I put this IP after checking my machine by whatismyip.com
>>>> My ISP provides dynamic IP. Is there any way to tell nagios to permit
>>>> nrpe connection from
>>>> all ?
>>>>
>>>> thanks
>>>>         
>>> Is your nagis machine ip changes all the time ?
>>> or is it your devices Ip that is changing ?
>>>       
>> Hi Assaf,
>> thanks for your kind response.
>>
>> yes the local machine where the nagios is installed has dynamic address.
>> The Ip changes after every 2/3 days.
>> Hence I have to change the "allowed_hosts=" parameter accordingly at the
>> remote machine running nrpe daemon.
>> How can I solve this problem ?
>>
>> thanks
>>
>>     
>>> You do not need to tell nagios to permit the connection . you need to
>>> tell the nrpe on all the hosts you are checking that the nagios host's ip
>>> has been changed and has a new .
>>>
>>> As far as i know there is no automated plugin , what you can do is write
>>> a script to query the dns of your nagios and replace the existing IP with
>>> the new result .
>>>
>>> Assaf
>>>
>>>
>>>
>>>
>>> IMPORTANT . this email and the information in it may be confidential,
>>> legally privileged and/or protected by law. It is intended solely for the
>>> use of the person to whom it is addressed. If you are not the intended
>>> recipient, please notify the sender immediately and do not disclose the
>>> contents to any other person, use it for any purpose, or store or copy
>>> the information in any medium. Please also delete all copies of this
>>> email and any attachments from your system.
>>>
>>> We cannot guarantee the security or confidentiality of email
>>> communications. We do not accept any liability for losses or damages that
>>> you may suffer as a result of your receipt of this email including but
>>> not limited to computer service or system failure, access delays or
>>> interruption, data non-delivery or mis-delivery, computer viruses or
>>> other harmful components.
>>>
>>> Copyright in this email and any attachments belong to Select Service
>>> Partner UK Limited. Should you communicate with anyone at Select Service
>>> Partner UK Limited by email, you consent to us monitoring and reading any
>>> such correspondence.
>>>
>>> Nothing in this email shall be taken or read as suggesting, proposing or
>>> relating to any agreement concerted practice or other practice that could
>>> infringe UK or EC competition legislation.
>>>
>>> Select Service Partner UK Limited is a company registered in England and
>>> Wales (company number 05687183) whose registered office is at 1 The
>>> Heights, Brooklands, Weybridge. Surrey. KT13 0NY
>>>
>>>
>>>
>>> -------------------------------------------------------------------------
>>> This SF.Net email is sponsored by the Moblin Your Move Developer's
>>> challenge Build the coolest Linux based applications with Moblin SDK &
>>> win great prizes Grand prize is a trip for two to an Open Source event
>>> anywhere in the world
>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>> _______________________________________________
>>> 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
>>>       
>
>
>
>
>
>
> IMPORTANT . this email and the information in it may be confidential, legally
> privileged and/or protected by law. It is intended solely for the use of the
> person to whom it is addressed. If you are not the intended recipient, please
> notify the sender immediately and do not disclose the contents to any other
> person, use it for any purpose, or store or copy the information in any medium.
> Please also delete all copies of this email and any attachments from your
> system.
>
> We cannot guarantee the security or confidentiality of email communications. We
> do not accept any liability for losses or damages that you may suffer as a
> result of your receipt of this email including but not limited to computer
> service or system failure, access delays or interruption, data non-delivery or
> mis-delivery, computer viruses or other harmful components.
>
> Copyright in this email and any attachments belong to Select Service Partner UK
> Limited. Should you communicate with anyone at Select Service Partner UK Limited by
> email, you consent to us monitoring and reading any such correspondence.
>
> Nothing in this email shall be taken or read as suggesting, proposing or
> relating to any agreement concerted practice or other practice that could
> infringe UK or EC competition legislation.
>
> Select Service Partner UK Limited is a company registered in England and Wales
> (company number 05687183) whose registered office is at 1 The Heights, Brooklands, Weybridge. Surrey. KT13 0NY
>  
>  
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> 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
>
>   


-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Joydeep Bakshi, Linux System Admin
Kolkatainfoservices Pvt Ltd,
23A Royd Street, Kolkata 700016, India
Work Phone 91 033 40014784
http://infoservices.in/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
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