<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Cyme@_Blog &#187; Nagios et gateway SMS</title>
	<atom:link href="http://cymea.net/tag/nagios-et-gateway-sms/feed" rel="self" type="application/rss+xml" />
	<link>http://cymea.net</link>
	<description>Un site utilisant WordPress</description>
	<lastBuildDate>Mon, 06 Feb 2012 17:30:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
		<item>
		<title>Nagios et gateway SMS Ubuntu 8.10</title>
		<link>http://cymea.net/nagios/nagios-et-gateway-sms</link>
		<comments>http://cymea.net/nagios/nagios-et-gateway-sms#comments</comments>
		<pubDate>Sun, 18 Jan 2009 18:36:09 +0000</pubDate>
		<dc:creator>fdevil</dc:creator>
				<category><![CDATA[Nagios]]></category>
		<category><![CDATA[Nagios et gateway SMS]]></category>

		<guid isPermaLink="false">http://cymea.net/?p=128</guid>
		<description><![CDATA[Avoir une notification par SMS avec Nagios pré requis : gnokii &#8211; un téléphone (Nokia E50) &#8211; un cable USB (DKU2) &#8211; nagios Installation Connecter votre cable au pc puis votre téléphone, pour le Nokia E50, activer PCSuite depuis le téléphone. Vérifier que votre téléphone est bien reconnu : ls /dev/ttyACM* Votre téléphone devrait se ]]></description>
			<content:encoded><![CDATA[<h3>Avoir une notification par SMS avec Nagios</h3>
<h4>pré requis :</h4>
<p>gnokii &#8211; un téléphone (Nokia E50) &#8211; un cable USB (DKU2) &#8211; nagios</p>
<h4>Installation</h4>
<p>Connecter votre cable au pc puis votre téléphone, pour le Nokia E50, activer PCSuite depuis le téléphone.</p>
<p>Vérifier que votre téléphone est bien reconnu :</p>
<p><code>ls /dev/ttyACM*</code></p>
<p>Votre téléphone devrait se trouver sur /dev/ttyACM0, c&#8217;est depuis ce périphérique que le logiciel enverra les sms.</p>
<p>Installer l&#8217;utilitaire Gnokii :</p>
<p><code>apt-get install gnokii</code></p>
<p>Editer le fichier /etc/gnokiirc et rechercher les lignes suivantes pour les modifier :</p>
<p><pre><code>port = /dev/ttyACM0

model = AT

connection = serial</code></pre></p>
<p>pour tester l&#8217;envoi en direct :</p>
<p><code>echo &quot;test envoi SMS Gnokii&quot; | gnokii --config /etc/gnokiirc --sendsms +33123456789</code></p>
<p>Ensuite, donner les droits d&#8217;émission à Nagios pour qu&#8217;il puisse envoyer les sms et mettre l&#8217;utilisateur nagios dans le groupe dialout.</p>
<p>Editer le fichier /etc/group, ajouter l&#8217;utilisateur nagios au groupe dialout :</p>
<p><code>usermod -G &quot;dialout&quot; &quot;nagios&quot;</code></p>
<p>Editer le fichier /etc/nagios3/conf.d/contact_nagios2.cfg et rajouter la notification par sms au contact:</p>
<p>[code lang="perl"]<br />
define contact{<br />
contact_name                    nagios<br />
alias                           Root<br />
service_notification_period     24x7<br />
host_notification_period        24x7<br />
service_notification_options    w,u,c,r<br />
host_notification_options       d,r<br />
service_notification_commands   notify-service-by-email, notify-by-sms<br />
host_notification_commands      notify-host-by-email, host-notify-by-sms<br />
email                           nagios@localhost<br />
pager				+33123456789<br />
}<br />
[/code]</p>
<p>Editer le fichier le fichier /etc/nagios/commands.cfg :</p>
<p>[code lang="perl"]<br />
define command{<br />
command_name    notify-by-sms<br />
command_line    echo "Service SMS : $NOTIFICATIONTYPE$ : $HOSTALIAS$ $SERVICEDESC$ is $SERVICESTATE$ ($OUTPUT$)" | gnokii --config /etc/gnokiirc --sendsms +33123456789<br />
}<br />
define command{<br />
command_name    host-notify-by-sms<br />
command_line    echo "Hote SMS : $NOTIFICATIONTYPE$ : $HOSTALIAS$ $SERVICEDESC$ is $SERVICESTATE$ ($OUTPUT$)" | gnokii --config /etc/gnokiirc --sendsms +33123456789<br />
}<br />
[/code]</p>
<p>Redémarrer Nagios :</p>
<p><code>/etc/init.d/nagios3 restart</code></p>
<p>Pour tester la notification, vous devoir avoir un changement d&#8217;état sur un service surveillé par Nagios (ex : SSH).</p>
<p>Stopper ce service et jeter un oeil dans le fichier /var/log/syslog</p>
<p><pre><code>/etc/init.d/ssh stop

tail -f /var/log/syslog</code></pre></p>
<p>Il faudra prendre un peu de temps mais vous aurez sous les yeux en regardant le syslog que nagios bosse pour connaitre l&#8217;état de votre service (ssh). Il va attendre un peu, histoire de prier un peu pour que le service redémarre avant de vous spamer votre GMS <img src='http://cymea.net/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> )</p>
<h4>Sources :</h4>
<p>http://doc.ubuntu-fr.org/gsm-nokia</p>
<p>http://www.moroblog.info/Configurer-Smstools.html</p>
<p>http://www.free-4ever.info/index.php/Nagios:notifications_sms</p>
<p>http://blog.nicolargo.com/2008/11/notifications-nagios-par-sms.html</p>
<p><span style="text-decoration: line-through;">http://www.free-4ever.info/index.php/Communications:SMStools</span></p>
<p>http://john.mcclumpha.org/linux/Build_your_own_SMS_gateway_with_Ubuntu_Linux_and_Gammu/</p>
<p>http://doc.ubuntu-fr.org/gammu</p>
<p>http://cihar.com/gammu/phonedb/nokia/352/</p>
<p>o:) http://www.zoneminder.com/forums/viewtopic.php?t=10976</p>
<p>http://dt.in.th/2008-01-02.linux-sending-sms.html</p>
<p>http://wiki.gnokii.org/index.php/Cables#DKU-2.2C_CA-53_and_CA-70</p>
<p>http://www.gnokii.org/docs.shtml#dku</p>
]]></content:encoded>
			<wfw:commentRss>http://cymea.net/nagios/nagios-et-gateway-sms/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

