<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td>
<td>
<div align=right><font size=1 face="sans-serif"><b>Ludo Bosmans <ludo.bosmans@xtenso.be></b></font>
<p><font size=1 face="sans-serif">19/05/2004 14:57</font></div>
<td><font size=1 face="Arial"> </font>
<br><font size=1 face="sans-serif"> To:
'Onsite DeTeWe' <Onsite.DeTeWe@firstgroup.com>,
nagios-users@lists.sourceforge.net</font>
<br><font size=1 face="sans-serif"> cc:
</font>
<br><font size=1 face="sans-serif"> Subject:
RE: [Nagios-users] SMS notifications</font></table>
<br>
<br>
<br>
<br><font size=2>Jason,</font>
<br><font size=3> </font>
<br><font size=2>To avoid lots of replies, work step by step and
try to document symptoms in detail..</font>
<br><font size=3> </font>
<br><font size=2>1. Do the command work manually as root ?</font>
<br>
<br><font size=2>Yes</font>
<br>
<br><font size=2>2. Do a su - nagios and try the command again. If
it doesn't work. What is the error message ?</font>
<br>
<br><font size=2>Yes with following.</font>
<br><font size=2>[nagios@SNMPServer etc]$ /usr/bin/printf "%b"
"Service: $SERVICEDESC$\nHost: $HOSTNAME$\nAddress: $HOSTADDRESS$\nState:
$SERVICESTATE$\nInfo: $OUTPUT$\nDate: $DATETIME$" | /usr/local/bin/gnokii
--sendsms 07901854342</font>
<br><font size=2>fopen: Permission denied</font>
<br><font size=2>WARNING: cannot open logfile, logs will be directed to
stderr</font>
<br><font size=2>GNOKII Version 0.6.1</font>
<br><font size=2>write: [ATZ<cr>]</font>
<br><font size=2>read : [ATZ<cr><cr><lf>OK<cr><lf>]</font>
<br><font size=2>write: [ATE1<cr>]</font>
<br><font size=2>read : [ATE1<cr><cr><lf>OK<cr><lf>]</font>
<br><font size=2>write: [AT+CGMM<cr>]</font>
<br><font size=2>read : [AT+CGMM<cr><cr><lf>Nokia 6310i<cr><lf><cr><lf>OK<cr><lf>]</font>
<br><font size=2>write: [AT+CGMI<cr>]</font>
<br><font size=2>read : [AT+CGMI<cr><cr><lf>Nokia<cr><lf><cr><lf>OK<cr><lf>]</font>
<br><font size=2>write: [AT+CSCS?<cr>]</font>
<br><font size=2>read : [AT+CSCS?<cr><cr><lf>+CSCS: "PCCP437"<cr><lf><cr><lf>OK<cr><lf>]</font>
<br><font size=2>write: [AT+CSCA?<cr>]</font>
<br><font size=2>read : [AT+CSCA?<cr><cr><lf>+CSCA: "+44780200xxxx",145<cr><lf><cr><lf>OK<cr><lf>]</font>
<br><font size=2>write: [AT+CMGF=0<cr>]</font>
<br><font size=2>read : [AT+CMGF=0<cr><cr><lf>OK<cr><lf>]</font>
<br><font size=2>write: [AT+CMGS=70<cr>]</font>
<br><font size=2>read : [AT+CMGS=70<cr><cr><lf>> ]</font>
<br><font size=2>write: [079144872000302311000B817009814543F20000AA40D3B2DC9E1E9775208102F99ED375A0A9B3099D96E5F6B25CA00892C9F2F27CAE030914537A985ED681048AA4DBFCD681040A62985ED68104^Z]</font>
<br><font size=2>read : [079144872000302311000B817009814543F20000AA40D3B2DC9E1E9775208102F99ED375A0A9B3099D96E5F6B25CA00892C9F2F27CAE030914537A985ED681048AA4DBFCD681040A62985ED68104^Z<cr><lf>+CMGS:
37<cr><lf><cr><lf>OK<cr><lf>]</font>
<br><font size=2>Send succeeded!</font>
<br>
<br><font size=2>3. Do you have read and write permissions on the
serial port specified in the gnokiirc file as the nagios user ?</font>
<br>
<br><font size=2>Yes</font>
<br>
<br><font size=2>4. correct is necessary.</font>
<br><font size=2>5. Is there a getty process on it ? Disable it in
/etc/inittab and do "init q", check if process is not respawned
anymore.</font>
<br>
<br><font size=2>No</font>
<br>
<br><font size=2>6. Check access rights again from serial device.</font>
<br>
<br><font size=2>Works from command line, just not from within nagios.</font>
<br><font size=2>Extract from syslog</font>
<br>
<br><font size=2>May 19 15:53:48 SNMPServer nagios: HOST ALERT: sw6-1;UP;HARD;1;PING
OK - Packet loss = 0%, RTA = 34.49 ms</font>
<br><font size=2>May 19 15:53:48 SNMPServer nagios: HOST NOTIFICATION:
network;sw6-1;UP;<b>host-notify-by-sms</b>;PING OK - Packet loss = 0%,
RTA = 34.49 ms</font>
<br>
<br><font size=2>7. Try to set the suid flag as root, just to see
if this fix the problem.</font>
<br>
<br><font size=3>No effect.</font>
<br>
<br><font size=3>snippet from the misccommands.cfg file showing sms trigger</font>
<br>
<br><font size=3># 'host-notify-by-email' command definition</font>
<br><font size=3>define command{</font>
<br><font size=3> command_name host-notify-by-email</font>
<br><font size=3> command_line /usr/bin/printf
"%b" "***** Nagios *****\n\nNotificatio</font>
<br><font size=3>n Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress:
$HOST</font>
<br><font size=3>ADDRESS$\nInfo: $OUTPUT$\n\nDate/Time: $DATETIME$\n"
| /bin/mail -s "Host $HOSTS</font>
<br><font size=3>TATE$ alert for $HOSTNAME$!" $CONTACTEMAIL$</font>
<br><font size=3> }</font>
<br>
<br><font size=3># 'host-notify-by-sms' command definition</font>
<br><font size=3>define command{</font>
<br><font size=3> command_name host-notify-by-sms</font>
<br><font size=3> command_line /usr/bin/printf
"%b" "**Nagios**\nType: $NOTIFICATIONTYP</font>
<br><font size=3>E$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo:
$OUTPUT$</font>
<br><font size=3>\nDate/Time: $DATETIME$\n" | /usr/local/bin/gnokii
--sendsms 07901845342</font>
<br><font size=3> </font>
<br><font size=2>kind regards,</font>
<br><font size=3> </font>
<br><font size=2>Jason</font>
<br><font size=3> </font>
<br><font size=3> </font>
<br><font size=2>-----Original Message-----</font>
<br><font size=2><b>From:</b> Onsite DeTeWe [mailto:Onsite.DeTeWe@firstgroup.com]</font>
<br><font size=2><b>Sent:</b> woensdag 19 mei 2004 14:02</font>
<br><font size=2><b>To:</b> Ludo Bosmans; nagios-users@lists.sourceforge.net</font>
<br><font size=2><b>Subject:</b> RE: [Nagios-users] SMS notifications</font>
<br>
<br>
<br>
<br><font size=2>Hiya,</font><font size=3> </font>
<br>
<br><font size=2>Yeah sorry.. Should have explained in full.</font><font size=3>
</font>
<br>
<br><font size=2>I have a host-notify-by-sms and notify-by-sms in the .cfg.
One for service and one for host. The snippet I sent
was for a host down.</font><font size=3> </font>
<br>
<br><font size=2>Really puzzling as the other commands in the .cfg
for host-notify-by-email and notify-by-email work fine. All
I did was replace them.</font><font size=3> </font>
<br>
<br><font size=2>J</font><font size=3> </font>
<br>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=1%>
<td width=31%>
<div align=right><font size=1><b>Ludo Bosmans <ludo.bosmans@xtenso.be></b></font><font size=3>
</font>
<br>
<br><font size=1>19/05/2004 11:59</font></div>
<td width=66%><font size=1> </font>
<br><font size=1> To:
'Onsite DeTeWe' <Onsite.DeTeWe@firstgroup.com>, Ludo Bosmans
<ludo.bosmans@xtenso.be>, nagios-users@lists.sourceforge.net</font><font size=3>
</font>
<br><font size=1> cc: </font><font size=3>
</font>
<br><font size=1> Subject:
RE: [Nagios-users] SMS notifications</font></table>
<br>
<br>
<br>
<br><font size=2>Jason,</font><font size=3> </font>
<br><font size=3> </font>
<br><font size=2>I suppose that the manual test is ok ? Of
course replace the macros with the corresponding values.</font><font size=3>
</font>
<br><font size=3> /usr/bin/printf "%b" "**Nagios**\nType:
$NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress:
$HOSTADDRESS$\nInfo: $OUTPUT$\nDate/Time: $DATETIME$\n"
| /usr/local/bin/gnokii --sendsms $CONTACTPAGER$ </font>
<br><font size=3> </font>
<br><font size=3>In the checkcommands you have a "notify-by-sms",
but in the syslog there is "host-notify-by-sms", so you
need to check the syntax of that config entry and try manually
to execute the command to see if it works. </font>
<br><font size=3> </font>
<br><font size=3>kind regards, </font>
<br><font size=3> </font>
<br><font size=3>ludo </font>
<br><font size=2> </font><font size=3> </font>
<br>
<br>
<br><font size=2>-----Original Message-----</font><font size=3> </font>
<br><font size=2><b>From:</b> Onsite DeTeWe [mailto:Onsite.DeTeWe@firstgroup.com]</font><font size=3>
</font>
<br><font size=2><b>Sent:</b> woensdag 19 mei 2004 12:22</font><font size=3>
</font>
<br><font size=2><b>To:</b> Ludo Bosmans; nagios-users@lists.sourceforge.net</font><font size=3>
</font>
<br><font size=2><b>Subject:</b> RE: [Nagios-users] SMS notifications</font><font size=3>
</font>
<br>
<br>
<br>
<br><font size=2>Thanks for your reply,</font><font size=3> </font>
<br>
<br><font size=2>I do have a nokia connected to the serial port,
but I am using the phone to send the texts.</font><font size=3> </font>
<br>
<br><font size=2>Regarding the macro, I have also tried just using
the mobile number for a test. This still does not work. Here
is a syslog message when a host does down.</font><font size=3>
</font>
<br>
<br><font size=2>May 19 11:11:48 SNMPServer nagios: HOST NOTIFICATION:
server;fiplog01;UP;<b>host-notify-by-sms</b>;PING OK - Packet loss
= 0%, RTA = 58.53 ms</font><font size=3> </font>
<br>
<br><font size=2>As you can see the trigger is being used, just
nothing more happening.</font><font size=3> </font>
<br>
<br><font size=2>Jason</font><font size=3> </font>
<br>
<br>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=1%>
<td width=34%>
<div align=right><font size=1><b>Ludo Bosmans <ludo.bosmans@xtenso.be></b></font><font size=3>
</font>
<br>
<br><font size=1>19/05/2004 11:06</font></div>
<td width=64%><font size=1> </font>
<br><font size=1> To:
'Onsite DeTeWe' <Onsite.DeTeWe@firstgroup.com>, nagios-users@lists.sourceforge.net</font><font size=3>
</font>
<br><font size=1> cc:
</font><font size=3> </font>
<br><font size=1> Subject:
RE: [Nagios-users] SMS notifications</font></table>
<br>
<br>
<br>
<br><font size=2>Hi Jason,</font><font size=3> </font>
<br><font size=3> </font>
<br><font size=2>I use also gnokii to send sms's. I don't
know your set-up, do you have a Nokia connected to a serial
port ?</font><font size=3> </font>
<br><font size=2>Imy configuration i have a modem
connected to the serial port and i establish a call to
a local provider smc center. So i am able to drop more then
1 sms at the time in one connection. Only the call to the smc
center is charged. No charge for the sms's itself.</font><font size=3>
</font>
<br><font size=3> </font>
<br><font size=2>So i can not really simulate, but it seems
for me that the $CONTACTPAGERS$ macro is wrong, it must be
$CONTACTPAGER$.</font><font size=3> </font>
<br><font size=3> </font>
<br><font size=2>kind regards,</font><font size=3> </font>
<br><font size=3> </font>
<br><font size=2>ludo</font><font size=3> </font>
<br><font size=2>-----Original Message-----</font><font size=3>
</font>
<br><font size=2><b>From:</b> Onsite DeTeWe [mailto:Onsite.DeTeWe@firstgroup.com]</font><font size=3>
</font>
<br><font size=2><b>Sent:</b> woensdag 19 mei 2004 11:34</font><font size=3>
</font>
<br><font size=2><b>To:</b> nagios-users@lists.sourceforge.net</font><font size=3>
</font>
<br><font size=2><b>Subject:</b> [Nagios-users] SMS notifications</font><font size=3>
</font>
<br>
<br>
<br>
<br><font size=2>Hi All,</font><font size=3> </font>
<br>
<br><font size=2>I have just setup a mobile gateway on our nagios
box (6310i with serial lead ;-). Got all the SMS stuff
working using gnokii which works a treat. Recommend it to anyone.
However, when I try and get nagios to use a new notify
routine it fails to send the text.</font><font size=3> </font>
<br>
<br><font size=2>Debug so far.</font><font size=3> </font>
<br>
<br><font size=2>Got gnokii to send SMS direct.</font><font size=3>
</font>
<br><font size=2>Added notify-by-sms to misccommands.cfg.</font><font size=3>
</font>
<br><font size=2> I know the above
works as I then cut the command from the .cfg and run it from
the command line direct and it works.</font><font size=3> </font>
<br>
<br><font size=2>Could this be a permissions thing associated with
the nagios user???</font><font size=3> </font>
<br>
<br><font size=2>When I force a host down and look in the syslog
the notification does try and send via the correct command,
it seems like just the command from within nagios is not working.</font><font size=3>
</font>
<br>
<br><font size=2>Hope someone can help.</font><font size=3>
</font>
<br>
<br><font size=2>Regards</font><font size=3> </font>
<br>
<br><font size=2>Jason</font><font size=3> </font>
<br>
<br>
<br>
<br><font size=2>This is the command line.</font><font size=3>
</font>
<br>
<br><font size=2>/usr/bin/printf "%b" "**Nagios**\nType:
$NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress:
$HOSTADDRESS$\nInfo: $OUTPUT$\nDate/Time: $DATETIME$\n"
| /usr/local/bin/gnokii --sendsms $CONTACTPAGERS$</font><font size=3>
</font>
<br>
<br><font size=3>**********************************************************************
</font>
<br><font size=3>This message is confidential. It may not be
disclosed to, or used by, </font>
<br><font size=3>anyone other than the addressee. If
you receive this message in </font>
<br><font size=3>error, please advise us immediately. </font>
<br>
<br><font size=3>Internet email is not necessarily secure. First
does not accept </font>
<br><font size=3>responsibility for changes to any email which occur
after the email </font>
<br><font size=3>has been sent. Attachments to this email could contain
software </font>
<br><font size=3>viruses which could damage your system. First have
checked the </font>
<br><font size=3>attachments for viruses before sending, but
you should virus-check </font>
<br><font size=3>them before opening. </font>
<br>
<br><font size=3>http://www.firstgroup.com </font>
<br><font size=3>**********************************************************************
</font>
<br>
<br>
<br>
<br>