How to limit the amout of Nagios SMS notifications?

 
Thread Tools Search this Thread
Special Forums UNIX and Linux Applications Infrastructure Monitoring How to limit the amout of Nagios SMS notifications?
# 1  
Old 11-15-2011
How to limit the amout of Nagios SMS notifications?

Hi all,

I have Nagios 3.3.1 setup on Ubuntu Desktop 11.04.

I monitor approx. 50 hosts (mixture of Windows Servers, Switches, Firewalls) by PING only.

Down hosts are notified to me via email and SMS at the moment.

What I would like to so is limit the amount of SMS messages that are sent from my Nokia phone connected to my Ubuntu box.

As it stands I allow 3 checks 1 minute apart before I am alerted via email – after that I am alerted via email every 5 minutes until recovery.

I have just implemented the phone to SMS alerts aswell but I want to limit the amount of texts as I don’t want a text every 5 minutes until recovery for sanity reasons and also cost reasons!

This is what I would like to happen If a host goes down:

Email to be sent out on the 3rd failed check to the host (So 1st alert is sent out after 3 minutes of the host being down.)

Then……

I want to be alerted via email every 5 minutes for 25 minutes. Then no more email until the host recovers.

But……

I only want an SMS to be sent out on Notification Number 3. No SMS to be sent apart from host recovered.
Code:
Notification No.................Time Host Down...................Notification Method
.........1................................3 min.....................................Email............
.........2................................8 min.....................................Email............
.........3...............................13 min....................................Email, SMS..
.........4...............................18 min....................................Email............
.........5...............................23 min....................................Email............
.........6...............................28 min....................................Email............
.........RECOVER.....................?????.....................................Email, SMS..

Basically half of the hosts i am monitoring are in a data centre hooked up to a leased line fibre link to my office where my Nagios box is.
If the VPN goes down or our firewall has a spaz attack i dont want my phone thats hooked up to the ubuntu box sending out 100 odd texts per notification (50 odd hosts and 2 admins to notify)

Is this possible?

Thanks in advance

---------- Post updated at 12:46 PM ---------- Previous update was at 10:29 AM ----------

Ok so would this work?

I only deal with host groups - i have no service groups set up.
Code:
define hostescalation{
host_name.....................................Test Switch
first_notification.............................1
last_notification.............................6
notification_interval.......................5
contact_groups.............................admin email
escalation_options........................d,r

define hostescalation{
host_name.....................................Test Switch
first_notification.............................3
last_notification.............................7
notification_interval.......................0
contact_groups.............................admin sms
escalation_options........................d,r

Will this send out an email for N1,2,4,5,6 and an SMS for N3 only, then stop after the 6th notification due to the notification_interval.......................0 setting?

---------- Post updated at 02:27 PM ---------- Previous update was at 12:46 PM ----------

I have managed to get it working 95% with the following:
Code:
  	define hostescalation{
	host_name.....................................Test Switch
	first_notification.............................1
	last_notification.............................5
	notification_interval.......................5
	contact_groups.............................admin email
	escalation_options........................d,r
	}
  	
	define hostescalation{
	host_name.....................................Test Switch
	first_notification.............................3
	last_notification.............................3
	notification_interval.......................5
	contact_groups.............................admin sms
	escalation_options........................d,r
  	}
  	define hostescalation{
	host_name.....................................Test Switch
	first_notification.............................6
	last_notification.............................0
	notification_interval.......................0
	contact_groups.............................admin email
	escalation_options........................d,r
  	}

I get emails for N1-6 and also a text for N3.
Also get a recovery email but no recovery text.
Is this because i told it not to text me again after N3?



Cheers


Moderator's Comments:
Mod Comment Please use code tags!

Last edited by zaxxon; 11-15-2011 at 10:29 AM.. Reason: code tags, see PM
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. What is on Your Mind?

Disabling New Badge Notifications

Finally got around to this. Have added a UserCP option to disable "new badge" alerts in the user profile "options" area so anyone who finds the alerts annoying, feel free to disable them (since the are primary designed for new users): https://www.unix.com/members/1-albums215-picture1219.png ... (0 Replies)
Discussion started by: Neo
0 Replies

2. UNIX for Beginners Questions & Answers

No SMS notifications once ppp up

Hi all, I have an Siemens IoT2020 with a Sim7000e cellular board that I connect via USB to the board and connect to Telstra Cat-M1 network. I can send and receive SMS and do so using Node-Red but can also do with Minicom etc. When connected I get : root@iot2000:~# dmesg | grep USB ACPI:... (0 Replies)
Discussion started by: antc
0 Replies

3. Infrastructure Monitoring

Notifications not coming through

Issue: I'm not receiving notifications I can succesfully receive an e-mail if I do this on the command line: /usr/bin/mail -s "NAGIOS HOST ALERT on $HOSTNAME$" rgouette@butlerbros.com but, my command.cfg configuration below, refuses to send an e-mail when I set a service to a critical... (3 Replies)
Discussion started by: rgouette
3 Replies

4. Infrastructure Monitoring

Nagios check dependent on second nagios server

We have a dual Nagios server setup. One is setup for internal server monitoring on our LAN, while the second Nagios server is hosted externally and is used for external checks only such as URL and ping checks form the WAN side. I was wondering if there is any way to setup cross dependencies... (1 Reply)
Discussion started by: eugenes18t
1 Replies

5. Infrastructure Monitoring

Cut down notifications from Nagios

Hello, I am currently monitoring about 40 hosts using NsClient. Each host has between 5-8 services running on each of them. I was trying to find a way to get less notifications because I'm currently getting about 200 a week. Is there anyway for if one service goes down on a host to make nagios... (5 Replies)
Discussion started by: Jethro
5 Replies

6. Solaris

Expiring password notifications

I have a Solaris 10 server that notified one of my users/database administrators of another users account expiring within X amount of days. It attempted to email the user@ server.com, which failed and was forwarded from the mailer-daemon@ server.com, to the DBA. She's not listed as an alias for... (2 Replies)
Discussion started by: Nvizn
2 Replies

7. Solaris

Limit: stacksize: Can't remove limit

Hi all, I'm using to Solaris machine. When I run a simple script this messenger come out:"limit: stacksize: Can't remove limit". Any one know the way to resolve this problem without reboot the machine? Thanks in advance. (3 Replies)
Discussion started by: Diabolist9
3 Replies

8. Solaris

Solaris E-Mail Notifications ?!

Hi , I need to have a monitoring system also I wanna have E-Mail Notification .or SMS notification to be on touch with my System : ) ... Regards Adel (1 Reply)
Discussion started by: ArabOracle.com
1 Replies

9. Post Here to Contact Site Administrators and Moderators

trying to turn email notifications off

I'm trying to disable the email notifications; despite going into my control panel and selecting NO next to Use 'Email Notification' by default? I keep getting email notifications anyway! And I know I've never selected the checkbox next to Email Notification: emails sent to you whenever someone... (2 Replies)
Discussion started by: oombera
2 Replies
Login or Register to Ask a Question