Re: [Nagios-users] How to get reboot messages
Sample command and uptime service is below. I have taken it from objects.cache to show all the details. Note that is is volatile and only alerts on warnings:- |define command { | command_namecheck_snmp_uptime | command_line$USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o 1.3.6.1.2.1.1.3.0 -w 42000: -t 45 | } |define service { | host_name xxx | service_description uptime | check_period24x7 | check_command check_snmp_uptime!readcommunity | contact_groups xxx | notification_period 24x7 | initial_state o | check_interval 5.00 | retry_interval 5.00 | max_check_attempts 1 | is_volatile 1 | parallelize_check 1 | active_checks_enabled 1 | passive_checks_enabled 1 | obsess_over_service 1 | event_handler_enabled 1 | low_flap_threshold 0.00 | high_flap_threshold 0.00 | flap_detection_enabled 1 | flap_detection_options o,w,u,c | freshness_threshold 0 | check_freshness 0 | notification_optionsw | notifications_enabled 1 | notification_interval 0.00 | first_notification_delay0.00 | stalking_optionsn | process_perf_data 1 | failure_prediction_enabled 1 | retain_status_information 1 | retain_nonstatus_information1 | } This config will occasionally give two successive warnings for one reboot, which I intend to adjust in due course. Hope this helps. Best wishes, Matthew -- >From: "chris serafin" <[EMAIL PROTECTED]> >To: "Matthew Richardson" <[EMAIL PROTECTED]> >Cc: >Date: Tue, 4 Dec 2007 13:45:22 -0600 >Subject: Re: [Nagios-users] How to get reboot messages >Any chance you could post your service/command configs? > >Chris > >On Dec 1, 2007 3:05 AM, Matthew Richardson <[EMAIL PROTECTED]> >wrote: > >> SNMP works fine in Windows for uptime monitoring... >> >> Best wishes, >> Matthew >> -- >> >From: "chris serafin" <[EMAIL PROTECTED]> >> >To: "Steve Shipway" <[EMAIL PROTECTED]> >> >Cc: Nagios-users@lists.sourceforge.net >> >Date: Thu, 29 Nov 2007 15:08:37 -0600 >> >Subject: Re: [Nagios-users] How to get reboot messages >> >> >So SNMP won't work with Windows? Damn, clients hate extra software. :( >> >> - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 ___ Nagios-users mailing list Nagios-users@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
Re: [Nagios-users] How to get reboot messages
SNMP works fine in Windows for uptime monitoring... Best wishes, Matthew -- >From: "chris serafin" <[EMAIL PROTECTED]> >To: "Steve Shipway" <[EMAIL PROTECTED]> >Cc: Nagios-users@lists.sourceforge.net >Date: Thu, 29 Nov 2007 15:08:37 -0600 >Subject: Re: [Nagios-users] How to get reboot messages >So SNMP won't work with Windows? Damn, clients hate extra software. :( - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 ___ Nagios-users mailing list Nagios-users@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
Re: [Nagios-users] How to get reboot messages
So SNMP won't work with Windows? Damn, clients hate extra software. :( Would you be willing to post your commands/services configs? I bet if I see your configs I may be able to replicate it to SNMP/windows. Thanks [EMAIL PROTECTED] On Nov 29, 2007 2:57 PM, Steve Shipway <[EMAIL PROTECTED]> wrote: > Here, we do this by checking the uptime of the host/device.For > switches etc, this is in the SNMP counter. For windows hosts, it is via > check_nt and the UPTIME object. For unix, you just create an appropriate > script to run via nrpe. > > We then do a critical if uptime < 10min. Since hosts are checked every > 5min at most then even if the hosts reboots quickly, this will alert. A > scheduled outage is OK because the scheduled downtime extends 10min after > the reboot. > > > > Steve > > > -- > > I have a bunch of devices which alert me fine up/down, but I'm looking to > find how to get messages when they reboot. Solarwinds does this for me now, > but I'm trying to move off this solution, but my boss want reboot messages > as well as up/downs for the devices... > > - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4___ Nagios-users mailing list Nagios-users@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
Re: [Nagios-users] How to get reboot messages
Here, we do this by checking the uptime of the host/device.For switches etc, this is in the SNMP counter. For windows hosts, it is via check_nt and the UPTIME object. For unix, you just create an appropriate script to run via nrpe. We then do a critical if uptime < 10min. Since hosts are checked every 5min at most then even if the hosts reboots quickly, this will alert. A scheduled outage is OK because the scheduled downtime extends 10min after the reboot. Steve I have a bunch of devices which alert me fine up/down, but I'm looking to find how to get messages when they reboot. Solarwinds does this for me now, but I'm trying to move off this solution, but my boss want reboot messages as well as up/downs for the devices... - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4___ Nagios-users mailing list Nagios-users@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
Re: [Nagios-users] How to get reboot messages
Thanks for all the replies, these would be Windows servers, Cisco/Juniper devices and Checkpoint boxes running mainly on SPLAT (linux) I prefer to do this with SNMP, as that's how I have done it on Solarwinds. I will be trying the SNMP_uptime command and report my results. [EMAIL PROTECTED] On Nov 29, 2007 12:03 PM, Edwin Zoeller <[EMAIL PROTECTED]> wrote: > You could create a script in /etc/rc2.d or rc3.d that will page/email > upon shutdown/startup. > > -- > *From:* [EMAIL PROTECTED] [mailto: > [EMAIL PROTECTED] *On Behalf Of *chris serafin > *Sent:* Thursday, November 29, 2007 12:00 PM > *To:* Nagios-users@lists.sourceforge.net > *Subject:* [Nagios-users] How to get reboot messages > > I have a bunch of devices which alert me fine up/down, but I'm looking to > find how to get messages when they reboot. Solarwinds does this for me now, > but I'm trying to move off this solution, but my boss want reboot messages > as well as up/downs for the devices... > > Any ideas? > > Chris Serafin > [EMAIL PROTECTED] > - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4___ Nagios-users mailing list Nagios-users@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
Re: [Nagios-users] How to get reboot messages
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Donnell Lewis wrote: > You could also (if it's linux) just put a simple mail command with > message in /etc/rc.local which executes after system boot and init. > Duh! That's so simple I wasn't even thinking about it. I was thinking of how to have it checked in Nagios, so see it in the web interface that it was rebooted. :) Max -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.6 (GNU/Linux) iD8DBQFHTwxKHoeeepPau2ERAhUYAKCUKiBCtVYhzl8mbBk2l3o5acwtXgCgw4P2 NwcIMRgeKePQOlyhaYsUmKA= =bqYi -END PGP SIGNATURE- - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 ___ Nagios-users mailing list Nagios-users@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
Re: [Nagios-users] How to get reboot messages
if you're trying to check windows boxes, I wouldn't use this snmp value because I don't think it's set reliably. I've been using "check_nt -v UPTIME" for those (but i still think it resets correctly at reboot). Also, it may not say "0 days" (so you could look to see if "days" doesn't show up); it may just give a time such as the following: libexec # snmpget -v1 -c hrSystemUptime.0 HOST-RESOURCES-MIB::hrSystemUptime.0 = Timeticks: (8082663) 22:27:06.63 you'll have to play around w/ it, I guess (sorry for the top-posting). - Josh From: [EMAIL PROTECTED] on behalf of Yost, Josh Sent: Thu 11/29/2007 12:47 PM To: chris serafin; Nagios-users@lists.sourceforge.net Subject: Re: [Nagios-users] How to get reboot messages hi, One simple idea is to use the Uptime number from SNMP ("hrSystemUptime.0"), and if that ever says "0 days" then you get an alert. I have a script that does a little more than this, but that's the basic idea. you should be able to do this with check_snmp (or a quick perl script that uses snmpget and does regular expression matches). - Josh From: [EMAIL PROTECTED] on behalf of chris serafin Sent: Thu 11/29/2007 11:59 AM To: Nagios-users@lists.sourceforge.net Subject: [Nagios-users] How to get reboot messages I have a bunch of devices which alert me fine up/down, but I'm looking to find how to get messages when they reboot. Solarwinds does this for me now, but I'm trying to move off this solution, but my boss want reboot messages as well as up/downs for the devices... Any ideas? Chris Serafin [EMAIL PROTECTED] - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4___ Nagios-users mailing list Nagios-users@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
Re: [Nagios-users] How to get reboot messages
You could also (if it's linux) just put a simple mail command with message in /etc/rc.local which executes after system boot and init. -Don On Thu, 2007-11-29 at 11:59 -0600, chris serafin wrote: > I have a bunch of devices which alert me fine up/down, but I'm looking > to find how to get messages when they reboot. Solarwinds does this for > me now, but I'm trying to move off this solution, but my boss want > reboot messages as well as up/downs for the devices... > > Any ideas? > > Chris Serafin > [EMAIL PROTECTED] > - > SF.Net email is sponsored by: The Future of Linux Business White Paper > from Novell. From the desktop to the data center, Linux is going > mainstream. Let it simplify your IT future. > http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 > ___ Nagios-users mailing list > Nagios-users@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 - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 ___ Nagios-users mailing list Nagios-users@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
Re: [Nagios-users] How to get reboot messages
hi, One simple idea is to use the Uptime number from SNMP ("hrSystemUptime.0"), and if that ever says "0 days" then you get an alert. I have a script that does a little more than this, but that's the basic idea. you should be able to do this with check_snmp (or a quick perl script that uses snmpget and does regular expression matches). - Josh From: [EMAIL PROTECTED] on behalf of chris serafin Sent: Thu 11/29/2007 11:59 AM To: Nagios-users@lists.sourceforge.net Subject: [Nagios-users] How to get reboot messages I have a bunch of devices which alert me fine up/down, but I'm looking to find how to get messages when they reboot. Solarwinds does this for me now, but I'm trying to move off this solution, but my boss want reboot messages as well as up/downs for the devices... Any ideas? Chris Serafin [EMAIL PROTECTED] - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4___ Nagios-users mailing list Nagios-users@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
Re: [Nagios-users] How to get reboot messages
We have our site-specific init script do this on Linux and Solaris. We also dump the users from last into the mail just in case a user rebooted a lab machine. The general algorithm is: -build the input to /usr/lib/sendmail in some file -mail it with `cat $file | /usr/lib/sendmail -oi $emailAddress` -if shutting down, wait 10 seconds (this was for older Solaris, may not be needed) Make it run last on boots and first on shutdowns and you should be good. Cheers, Kevin - Kevin Sumner [EMAIL PROTECTED] (919) 962-6494 Assistant Systems Administrator Physics and Astronomy Networking Infrastructure and Computing University of North Carolina at Chapel Hill On Thu, 29 Nov 2007, Max Hetrick wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > chris serafin wrote: >> I have a bunch of devices which alert me fine up/down, but I'm looking >> to find how to get messages when they reboot. Solarwinds does this for >> me now, but I'm trying to move off this solution, but my boss want >> reboot messages as well as up/downs for the devices... >> >> Any ideas? > > Are you talking Linux? If not, ignore the rest of this message. :) > > If so, what about some type of script to write a flag file when the host > reboots. Then a script which checks to see if that flag file exists. If > it exists, exit with an OK status and delete the flag file. > > I set something similar to this up yesterday with an AS400 backup. My > boss was tired of getting a page off of a completed backup. He set > things up to write to an NFS share with a simple touch flag file. > > I then check to see if that files exists. If the backup completed > successfully the night before it sees the file, says ok, deletes the > file and exits normally. If the file isn't there, then it exits with an > error to which we get notified. > > #!/bin/bash > > FILE=/var/flags/AS400_DAILY > > if [ -f $FILE ]; then >echo "OK: AS400 backup completed normally." >rm -f $FILE >exit 0 >else >echo "CRIT: AS400 backup error." >exit 2 > fi > > A simple script of some sort linked to /etc/init.d could write the flag > file after the system boots and disks are mounted. Once that's there, > then you can check if the file exists. > > It's not elegant, but would work. If anyone has a better idea, please > chime in. > > Regards, > Max > -BEGIN PGP SIGNATURE- > Version: GnuPG v1.2.6 (GNU/Linux) > > iD8DBQFHTwcKHoeeepPau2ERArpDAJ4lVqyC5z2nWt2uBwD+aFiTBGOYQgCgtZ+f > rubEvG3ToHPGsm34ubat0UE= > =GUQs > -END PGP SIGNATURE- > > - > SF.Net email is sponsored by: The Future of Linux Business White Paper > from Novell. From the desktop to the data center, Linux is going > mainstream. Let it simplify your IT future. > http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 > ___ > Nagios-users mailing list > Nagios-users@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 > > > -- > > - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 ___ Nagios-users mailing list Nagios-users@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
Re: [Nagios-users] How to get reboot messages
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 chris serafin wrote: > I have a bunch of devices which alert me fine up/down, but I'm looking > to find how to get messages when they reboot. Solarwinds does this for > me now, but I'm trying to move off this solution, but my boss want > reboot messages as well as up/downs for the devices... > > Any ideas? Are you talking Linux? If not, ignore the rest of this message. :) If so, what about some type of script to write a flag file when the host reboots. Then a script which checks to see if that flag file exists. If it exists, exit with an OK status and delete the flag file. I set something similar to this up yesterday with an AS400 backup. My boss was tired of getting a page off of a completed backup. He set things up to write to an NFS share with a simple touch flag file. I then check to see if that files exists. If the backup completed successfully the night before it sees the file, says ok, deletes the file and exits normally. If the file isn't there, then it exits with an error to which we get notified. #!/bin/bash FILE=/var/flags/AS400_DAILY if [ -f $FILE ]; then echo "OK: AS400 backup completed normally." rm -f $FILE exit 0 else echo "CRIT: AS400 backup error." exit 2 fi A simple script of some sort linked to /etc/init.d could write the flag file after the system boots and disks are mounted. Once that's there, then you can check if the file exists. It's not elegant, but would work. If anyone has a better idea, please chime in. Regards, Max -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.6 (GNU/Linux) iD8DBQFHTwcKHoeeepPau2ERArpDAJ4lVqyC5z2nWt2uBwD+aFiTBGOYQgCgtZ+f rubEvG3ToHPGsm34ubat0UE= =GUQs -END PGP SIGNATURE- - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 ___ Nagios-users mailing list Nagios-users@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
[Nagios-users] How to get reboot messages
I have a bunch of devices which alert me fine up/down, but I'm looking to find how to get messages when they reboot. Solarwinds does this for me now, but I'm trying to move off this solution, but my boss want reboot messages as well as up/downs for the devices... Any ideas? Chris Serafin [EMAIL PROTECTED] - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4___ Nagios-users mailing list Nagios-users@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