How to Configure SMS for a Specfic Server

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
gm_rajkumar
Posts: 187
Joined: Tue Feb 28, 2012 7:08 am
Location: CA, USA

How to Configure SMS for a Specfic Server

Post by gm_rajkumar »

Hi

Im having high critical production server , i wanted to receive SMS for any service down for this. Other than this, i dont want to receive any alert through SMS for any of service/server alert.

I having Multi-tech SMS G/W for SMS distribution. Please let me know how to do that.

Regards,
Raj.
g.turri
Posts: 7
Joined: Tue Oct 16, 2012 3:51 am

Re: How to Configure SMS for a Specfic Server

Post by g.turri »

Hi,
usually an sms gateway has a folder in which a preformatted text file is created to be sent by the sms gateway.
You can modify the command.cfg adding, at the end of "notify-host-by-email command definition",

| /usr/bin/printf "To: cellular_phone_number\n\n$NOTIFICATIONTYPE$ Host: $HOSTNAME$ State: $HOSTSTATE$ Address: $HOSTADDRESS$ Info: $HOSTOUTPUT$ $LONGDATETIME$" > /var/spool/sms/outgoing/$(date +%y%m%d%N).sms

In this way only when a host goes down you'll receive an email and the sms (if you append the code).
You can also change the default command to send the email with this code: in this case you'll receive only the sms (I prefer to receive both) :-)

I hope to have helped you
gm_rajkumar
Posts: 187
Joined: Tue Feb 28, 2012 7:08 am
Location: CA, USA

Re: How to Configure SMS for a Specfic Server

Post by gm_rajkumar »

My requirement is i need an SMS for a specific server and their services. for example: i have an exchange server and it has some services like Microsoft Exchange Information Store service.

If that server or Service goes down, i need to get an SMS or Email from nagios.
Right now, i m getting all SMS and email from my nagios. Instead of this, i need to get SMS for this specific server and its services. Thats it, hope i cleared you better..
Thanks in Advance.

Regards,
Raj.
g.turri
Posts: 7
Joined: Tue Oct 16, 2012 3:51 am

Re: How to Configure SMS for a Specfic Server

Post by g.turri »

I think you should define several type of notification, link a specific notification type to a specific service and, finally, link the service to the host.
In this way you can
- Specify different type/text message of notification (and so add in the command.cfg file new notification command with preformatted text)
- Link the appropriate notification to a service (probably you'll have several service which are very similar each one) (it means to create new templates)
- Link the template to the service check
And, if you need, you can specify different recipients according to the service check....

I hope I've well understood your requairements :-)

Bye
gm_rajkumar
Posts: 187
Joined: Tue Feb 28, 2012 7:08 am
Location: CA, USA

Re: How to Configure SMS for a Specfic Server

Post by gm_rajkumar »

Thanks for the clarification,
And I have another doubt, I'm routing all alert notification through my SMS G/w (Mutlitech). I wanted to see the alerts that are generated in the nagios should be routed via SMS g/w. Is there any specific configuration there.
example: XYZ contact person->Server1-> Disk space alerts to be triggered (SMS and Email), other than this nothing else required. How can i get notified to specific user related to Server 1 alerts alone? currently all alerts are notified to everyone in contacts

Right now, all of alerts are sent to my no. This specific alerts should be pointed to another no and shown in SMS G/w.
Please let me know if you've any clarification over this.

Thanks
gm_rajkumar
Posts: 187
Joined: Tue Feb 28, 2012 7:08 am
Location: CA, USA

Re: How to Configure SMS for a Specfic Server

Post by gm_rajkumar »

I have found the solution, it could be crazy however it worked out for me. I have cloned a user with admin rights, after that he has got all sms and mails. I have revoked all services except from one specfic server, service. Its started works, then i removed admin rights. Now its working fine, i have achieved my objective. Thanks!!

Regards,
Raj.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: How to Configure SMS for a Specfic Server

Post by slansing »

That is a interesting work around, thank you for contributing your fix for the community.
Locked