Few questions about Nagios - reboot notification, value=x notification.
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Few questions about Nagios - reboot notification, value=x notification.
Hi everyone.
I'm strugling to find the way to notify myself when server was rebooted (on localhost and on remote host by ssh). Any ideas? plug-ins?.
I need also to set up notification on services when value will = to some special value (not like by defualt- notification when value bigger than warnning or critical).
Thank you for any help.
You could just add an init script to your servers that sends and email to you when it comes up. I'm assuming you're already doing a "PING" of some sort to tell when it is down. You wouldn't want it as critical AFTER it is down. Nagios will tell you when it went critical AND when it went back to OK and you configure how it does this with notifications in the service and host definitions using contacts and contactgroups.
If what you are asking is to have the Nagios service say when the last boot was you'd have to write a customized script that checks to see if it is up then print the "uptime" information. Nagios lets you create scripts where you can define "CRITICAL", "WARNING", "OK" and "UNDEFINED" statuses. With each of these you can print one line of text that will appear in your monitoring.
For your other question see last paragraph. You could set the value you want to be defined as "OK" but generate a different text line.
e.g. a script that does:
Between 0 and 5 = "OK" with text "This is operating at minimal level."
Between 6 and 10 = "OK" with text "This is somewhat loaded."
Between 10 and 15 = "WARNING" with text "You've reached minimum warning threshold."
Between 15 and 20 = "WARNING" with text "You are approaching critical theshold."
Between 20 and 25 = "CRITICAL" with text "System at low end of critical level".
Greater than 25 = "CRITICAL" with text "Oh my God, time to update the resume".
You can NOT have multiple lines in the text for a given status but can have multiple conditions that give you one of the statuses available with separate text as shown above.
The above is not the actual text of a script but is more a conceptual way of viewing it.
Hi,
Although I'm certainly no nagios expert, I would think you could get this notification by making use of the 'check-host-alive' command definition within nagios (should be enabled as part of the standard install I think). During the time when the server is being rebooted I don't think it'll be 'alive' as far as nagios is concerned. If it does report it as being alive then also try the 'check_ping' command as well. Eg in my commands.cfg file I have ...
then (and assuming your machine doesn't come up at the speed of light), one or both of these commands should result in one of more 'SOFT events' happening (ie a potential problem). Then you can configure to be notified (via email) after 1,2 or x failures. Eg (also from my commands.cfg)...
Then, and if you've configured an admin/notification email address (in contacts.cfg), you should get an email.
Another way you could perhaps achieve pretty much the same result is to use event handlers to run some script (which does the email notification), however I use the event handlers to actually reboot any unresponsive machines (so whilst I'll get notified, the rebooting process should have already happened by the time I'm trying to ssh in to reboot it myself).
Once you get it configured correctly I think you'll find it pretty powerful with all the things it can check (and then do with the event handlers)..
Alternatively perhaps you could just put some script within the init process which sends an email.
I have enabled the check-host-alive command, but still can't get Nagios to notify me as soon as the server reboots. I've messed with the timing in the check-host-alive setting, but I still can't get it to notify me when the server reboots
Basically, what I'm looking to do is get a notification when the server reboots. I mean as soon as that server reboots, I would like to be notified. Because when I look at the Service State Information, it tells me the next scheduled check will be in about 7min. Should I use something else for this notification?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.