Nagios father, script son ??

enrico fanti e.fanti at pointercom.it
Fri Nov 18 16:28:57 CET 2005


Hi to all.

Now my script works.

I added some kill signal to my script:

Instead of "/etc/init.d/nagios stop", I wrote "kill -s SIGSTOP $nagiospid",

and instead of "/etc/init.d/nagios start", I wrote "kill -s SIGCONT
$nagiospid"


Thank you to all for your help

Enrico



enrico fanti wrote:

> Hi,
>
> I obtain the same result.
>
> What do you think if would be possible
>  to put nagios process in stand by mode
>  while the scrpt restart the applications
>  and after
> to put in normal mode the nagios process ??
>
> It's really possible to put agenerally  process in stanby end after to
> put it in normal mode ?
> (Pheraps with the kill command ??)
>
> Thanks
>
> enrico
>
>
> Todd Barbera wrote:
>
>> /etc/init.d/nagios stop
>>
>> sleep 30
>>
>> ps -ef|grep nagios
>>
>> echo "now stopping sendmail"
>>
>> /etc/init.d/sendmail restart
>>
>> sleep 30
>>
>> echo "now calling named"
>>
>> /etc/init.d/named
>>
>> echo "now starting nagios"
>>
>> /etc/init.d/nagios start
>>
>>  
>>
>> This should give you a pretty good idea as to where the script is
>> failing, based on what echo statements get processed. If you're not
>> running the script interactively then redirect the output to a log,
>> i.e., /usr/local/nagios/bin/mynagios_script >
>> /usr/local/nagios/tmp/mynagios_script.log. These are basic script
>> debugging techniques. You may do well getting yourself a good shell
>> scripting reference guide.
>>
>>  
>>
>> Todd
>>
>>  
>>
>> -----Original Message-----
>> *From:* nagios-users-admin at lists.sourceforge.net
>> [mailto:nagios-users-admin at lists.sourceforge.net] *On Behalf Of
>> *enrico fanti
>> *Sent:* Friday, November 18, 2005 8:19 AM
>> *To:* Todd Barbera
>> *Cc:* nagios-users at lists.sourceforge.net
>> *Subject:* Re: [Nagios-users] Nagios father, script son ??
>>
>>  
>>
>> Hi Todd,
>>
>> I tried your hint, but isn't ok.
>>
>> Wath do you mean with "you could put in a process grep in the script" ?
>>
>> Thank you
>>
>> Enrico
>>
>>
>> Todd Barbera wrote:
>>
>>Hi Enrico,
>>
>> 
>>
>>Try putting in the following:
>>
>> 
>>
>>/etc/init.d/nagios stop
>>
>>sleep 30
>>
>>echo "now to stop sendmail"
>>
>>/etc/init.d/sendmail restart
>>
>>sleep 30
>>
>>echo "now to call named"
>>
>>/etc/init.d/named
>>
>> 
>>
>>This will help determine if the script is truly dying because the nagios
>>
>>process stops. 30 seconds should be far more time needed for nagios to
>>
>>shutdown, although I suppose you could put in a process grep in the script
>>
>>to verify.
>>
>> 
>>
>>Todd
>>
>> 
>>
>>----- Original Message ----- 
>>
>>From: "enrico fanti" <e.fanti at pointercom.it> <mailto:e.fanti at pointercom.it>
>>
>>To: <jpratt at norwich.edu> <mailto:jpratt at norwich.edu>; <nagios-users at lists.sourceforge.net> <mailto:nagios-users at lists.sourceforge.net>
>>
>>Sent: Friday, November 18, 2005 7:18 AM
>>
>>Subject: Re: [Nagios-users] Nagios father, script son ??
>>
>> 
>>
>> 
>>
>>  
>>
>>>Hi,
>>>
>>>I tried that but it doesn't work..
>>>
>>> 
>>>
>>>It seems to be very stange case...
>>>
>>> 
>>>
>>> 
>>>
>>> 
>>>
>>> 
>>>
>>>Jamie Pratt wrote:
>>>
>>> 
>>>
>>>    
>>>
>>>>did you try tagging an & on the end of the command line to fork it off
>>>>
>>>>into the background? sometimes this will help..
>>>>
>>>> 
>>>>
>>>>regards,
>>>>
>>>>jamie
>>>>
>>>> 
>>>>
>>>>-- 
>>>>
>>>> 
>>>>
>>>>James Pratt
>>>>
>>>>Unix Systems Administrator
>>>>
>>>>Norwich University - Information Technology
>>>>
>>>>jpratt at norwich.edu <mailto:jpratt at norwich.edu> | 1-802-485-2532
>>>>
>>>> 
>>>>
>>>> 
>>>>
>>>> 
>>>>
>>>>enrico fanti wrote:
>>>>
>>>> 
>>>>
>>>>      
>>>>
>>>>>Hi to all
>>>>>
>>>>> 
>>>>>
>>>>>I have this problem
>>>>>
>>>>> 
>>>>>
>>>>>Nagios executes a script.
>>>>>
>>>>>This script have to restart the Nagios process in this way:
>>>>>
>>>>> 
>>>>>
>>>>>/etc/init.d/nagios stop
>>>>>
>>>>>/etc/init.d/sendmail restart
>>>>>
>>>>>/etc/init.d/named
>>>>>
>>>>>/etc/init.d/nagios start
>>>>>
>>>>> 
>>>>>
>>>>>The problem is that when the script execute this sequence, it
>>>>>
>>>>>executes only:
>>>>>
>>>>> 
>>>>>
>>>>>/etc/init.d/nagios stop
>>>>>
>>>>>/etc/init.d/sendmail stop
>>>>>
>>>>> 
>>>>>
>>>>>It seems that the father Nagios execute the son script, but this
>>>>>
>>>>>script dies when the father dies (Nagios).
>>>>>
>>>>> 
>>>>>
>>>>> 
>>>>>
>>>>>Is there a way to run the son script separately from the father
>>>>>
>>>>>Thak you
>>>>>
>>>>> 
>>>>>
>>>>>Enrico
>>>>>
>>>>> 
>>>>>
>>>>>        
>>>>>
>>>> 
>>>>
>>>> 
>>>>
>>>>      
>>>>
>>>-- 
>>>
>>>=======================================
>>>
>>>Enrico Fanti
>>>
>>>PointerCom s.p.a - http://www.pointercom.it
>>>
>>>Via Francesco De Sanctis, 9
>>>
>>>00195 Roma - ITALY
>>>
>>>tel. +39-06-37591259
>>>
>>>fax +39-06-37591202
>>>
>>>e.fanti at pointercom.it <mailto:e.fanti at pointercom.it>
>>>
>>>================================
>>>
>>> 
>>>
>>> 
>>>
>>> 
>>>
>>> 
>>>
>>>    
>>>
>> 
>>
>> 
>>
>> 
>>
>> 
>>
>>  
>>
>>
>>
>>-- 
>>
>>=======================================
>>
>>Enrico Fanti
>>
>>PointerCom s.p.a - http://www.pointercom.it
>>
>>Via Francesco De Sanctis, 9
>>
>>00195 Roma - ITALY
>>
>>tel. +39-06-37591259
>>
>>fax +39-06-37591202
>>
>>e.fanti at pointercom.it <mailto:e.fanti at pointercom.it>
>>
>>================================ 
>>
>> 
>>
>> 
>>
>>------------------------------------------------------------------------
>>
>>No virus found in this incoming message.
>>Checked by AVG Free Edition.
>>Version: 7.1.362 / Virus Database: 267.13.3/174 - Release Date: 17/11/2005
>>  
>>
>
>-- 
>=======================================
>Enrico Fanti
>PointerCom s.p.a - http://www.pointercom.it
>Via Francesco De Sanctis, 9
>00195 Roma - ITALY
>tel. +39-06-37591259
>fax +39-06-37591202
>e.fanti at pointercom.it
>================================ 
>
>
>  
>
>No virus found in this incoming message.
>Checked by AVG Free Edition.
>Version: 7.1.362 / Virus Database: 267.13.4/175 - Release Date: 18/11/2005
>  
>

-- 
=======================================
Enrico Fanti
PointerCom s.p.a - http://www.pointercom.it
Via Francesco De Sanctis, 9
00195 Roma - ITALY
tel. +39-06-37591259
fax +39-06-37591202
e.fanti at pointercom.it
================================ 



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20051118/c2d33795/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: e.fanti.vcf
Type: text/x-vcard
Size: 238 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/users/attachments/20051118/c2d33795/attachment.vcf>


More information about the Users mailing list