How to send text notification
Leveau Stanislas
stanislas.leveau at ac-caen.fr
Thu Jul 11 12:42:31 CEST 2013
Hello
you can use gnookii : http://gnokii.org/
For example you install a SIEMENS MC35i on your server nagios
Manufacturer : SIEMENS
Model : MC35i
you need this information :
SMS Gateway telephone number : 06 ** ** ** **
Code PIN : 0000
Your Telephone number : 06 ** ** ** **
Gnokii installation an configuration :
Software installation (On redhat) :
# yum –enablerepo=* install gnokki
Add code PIN
# gnokii --entersecuritycode PIN
GNOKII Version 0.6.19
Enter your code: 0000
Code ok.
test it's ok:
# gnokii --getsecuritycodestatus
GNOKII Version 0.6.19
Security code status: nothing to enter.
gnokii configuration :
# cat /etc/gnokiirc
[global]
port = /dev/ttyS0
model = AT
initlength = default
connection = serial
use_locking = yes
serial_baudrate = 19200
smsc_timeout = 10 [gnokiid]
bindir = /usr/local/sbin/ [connect_script]
TELEPHONE = 12345678
[disconnect_script] [logging]
debug = off
rlpdebug = off
xdebug = off
Hardware informations :
# gnokii --identify
GNOKII Version 0.6.19
IMEI : 35358469542896
Manufacturer : SIEMENS
Model : MC35i
Product name : MC35i
Revision : REVISION 02.00
If you want to modif connexion parameters :
# minicom -s Pour sortir
Ctrl-A puis Z puis Q
Add port information :
# stty -F /dev/ttyS0
speed 19200 baud; line = 0;
min = 1; time = 0;
-brkint -icrnl -imaxbel
-opost -onlcr
-isig -icanon -iexten -echo -echoe -echok -echoctl -echoke
Test send a sms :
# echo "hello" | /usr/bin/gnokii --sendsms 06********
GNOKII Version 0.6.19
Send succeeded!
Nagios configuration :
In Nagios you add a notification commands as :
define command{
command_name notify-by-sms
command_line /usr/bin/printf "%b" "Service: $SERVICEDESC$\nHost: $HOSTNAME$\nState: $SERVICESTATE$\nInfo: $SERVICEOUTPUT$\nDate: $SHORTDATETIME$" | sudo /etc/nagios/envoiesms $CONTACTPAGER$
}
In /etc/nagios/envoiesms file :
/usr/bin/gnokii --sendsms $1
And in your contact definition :
define contact{
contact_name administrateur
alias administrateur
contactgroups group-sms
host_notification_period 24x7
service_notification_period 24x7
host_notification_options d,u,r
service_notification_options w,u,c,r
host_notification_commands notify-by-sms
service_notification_commands notify-by-sms
email administrateur at ac-caen.fr
pager 06********
}
Regards
Stan
Le 11/07/13, Yaho Brou <bylelu at yahoo.fr> a écrit :
>
>
>
>
>
> you can use a smsc gateway like kannel. it's easy and convenience.
>
>
> De : ", Roy" <rp346 at njit.edu>
> À : nagios-users <nagios-users at lists.sourceforge.net>
> Envoyé le : Jeudi 11 juillet 2013 2h12
> Objet : [Nagios-users] How to send text notification
>
>
> Hi,
>
>
> Anyone can help me to setup SMS notification from Nagios
>
>
> Thanks
>
>
>
>
>
>
> ------------------------------------------------------------------------------
> See everything from the browser to the database with AppDynamics
> Get end-to-end visibility with application monitoring from AppDynamics
> Isolate bottlenecks and diagnose root cause in seconds.
> Start your free trial of AppDynamics Pro today!
> http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
> _______________________________________________
> 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
>
>
>
>
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20130711/711aa933/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
-------------- next part --------------
_______________________________________________
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