event handlers - remounting smb shares
Kyle O'Donnell
kyleodonnell at gmail.com
Fri Mar 6 16:04:34 CET 2009
write the logic into the event handler script.
pass the $SERVICEOUTPUT$ to the event handler
have the event handler check if the appropriate moutpoint has returned
the desired (or undesired) error
if condition mount
else echo wrong mount failure dont do anything.
On 3/6/09, Assaf Flatto <assaf.flatto at ssp-intl.com> wrote:
> Hello Kyle
>
> You missed my point - i think .
>
> Doing checks on the remote machine is not a problem , i am doing so via NRPE
> and with no problems .
> My issue is - how do i make it dynamic - and not a different script for
> each mount point .
>
> I want it to be a single script that when i pass the arguments to the event
> handler over the nrpe ,
> i add the failed mount point as an argument .
>
> I took a look at rexec , but i am still in the same problem - how do i get
> the mount point
> extracted - figured from the output and pass it to the remount event handler
> ?
>
> Assaf
>
>
> On Friday 06 March 2009 14:03:04 Kyle O'Donnell wrote:
>> How do you check your systems remotely?
>>
>> search the nagiosexchange for something called 'rexec' it is an event
>> handler that I wrote that executes commands remotely using ssh or
>> NRPE.
>>
>> If using NRPE a script to run your mount should be written and added
>> to your nrpe.cfg command list.
>>
>>
>> if this is local, write a script do perform your mount, define it as a
>> command inside nagios, and select the defined command as the event
>> handler.
>>
>> On 3/6/09, Assaf Flatto <assaf.flatto at ssp-intl.com> wrote:
>> > Hello List
>> >
>> > I am having an issue with trying to implement event handlers .
>> >
>> > Let me explain the background first :
>> > We have a several servers that are rebooted every weekend and one of
>> > them
>> > is a file server with
>> > several exported mount points to other servers .
>> > After the reboots one of the machines is unable to recover the mount
>> > points ( could be cause we are
>> > still using smbfs and not cifs ) and we need to manually remount those
>> > filesystems .
>> >
>> > I wanted to implement an event handler to remount the "stuck" mount
>> > points after the reboot is
>> > complete ,( doing a "mount -f -a " is not an option ) , the problem i am
>> > facing is - how do i pass
>> > the mount point to the event handler ?
>> > is it at all possible ?
>> >
>> > the output from the command is as follows ;
>> > the error :
>> > [1235783450] Warning: The check of service 'sapmnt_PX1 disk space' on
>> > host 'host' looks like it was
>> > orphaned (results never came back). I'm scheduling an immediate check
>> > of
>> > the service...
>> >
>> > what is should be :
>> > DISK OK - free space:
>> > /public_data/PR1/interfaces/incoming/Lynx/UK/srf_mount 88720 MB
>> > (16%);|
>> > /public_data/PR1/interfaces/incoming/Lynx/UK/srf_mount=483424MB;572124;57
>> >2134;0;572144
>> >
>> > Anyone ever done something like this ?
>> > Any Ideas ?
>> > --
>> > Assaf Flatto
>> > SSP Ops Team
>> > Linux System Administrator
>> > 169 Euston Road, London, NW1 2AE
>> >
>> >
>> >
>> >
>> >
>> > 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
>> >
>> >
>> >
>> > -------------------------------------------------------------------------
>> >----- Open Source Business Conference (OSBC), March 24-25, 2009, San
>> > Francisco, CA -OSBC tackles the biggest issue in open source: Open
>> > Sourcing the Enterprise -Strategies to boost innovation and cut costs
>> > with open source participation -Receive a $600 discount off the
>> > registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H
>> > _______________________________________________
>> > 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
>
>
>
> --
> Assaf Flatto
> SSP Ops Team
> Linux System Administrator
> 169 Euston Road, London, NW1 2AE
>
>
>
>
>
> 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
>
>
>
> ------------------------------------------------------------------------------
> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
> -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
> -Strategies to boost innovation and cut costs with open source participation
> -Receive a $600 discount off the registration fee with the source code: SFAD
> http://p.sf.net/sfu/XcvMzF8H
> _______________________________________________
> 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
>
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
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