Page 2 of 3
Re: iSMS acknowledge alerts
Posted: Wed Nov 14, 2012 4:28 pm
by BanditBBS
hockad,
I didn't have ExecCgi enabled, so I added that to my Directory options and also enabled cgi running outside cgi-bin folder. My sms device is still getting same errors. However, if I manually browse to
http://server/smsfinder/smsack.cgi I now get "Internal Service Error" instead of it actually showing the contents of the script before I added the ExecCGI. Any dealings with this issue in your deployment?
Re: iSMS acknowledge alerts
Posted: Wed Nov 14, 2012 4:39 pm
by slansing
I believe you must forward the message to the SMS device's number with ACK or OK at the front of the message. At least that's what I've been attempting..to no avail

Re: iSMS acknowledge alerts
Posted: Wed Nov 14, 2012 4:42 pm
by BanditBBS
slansing wrote:I believe you must forward the message to the SMS device's number with ACK or OK at the front of the message. At least that's what I've been attempting..to no avail

LOL, glad to see someone else suffering with me. I can't get mine past trying to connect to nagios server. Still getting error in logs on sms device that I posted earlier.
Good luck! (Then you can make it part of the component)
Re: iSMS acknowledge alerts
Posted: Wed Nov 14, 2012 5:06 pm
by slansing
Bandit have you checked your line endings for the cgi file? They may be in windows format.
I am now getting this:
Code: Select all
smsack.cgi: Use of uninitialized value $SenderNumber in pattern match (m//) at /usr/local/smsack/bin/smsack.cgi line 75.
Lines 45, 48, 52, 54, 62, 67, 74, and 75 as noted above. A combination of $SenderNumber, Concatenation, and $Message. Going to do some more digging if time provides tomorrow, but it seems the instructions may not be totally complete yet

Re: iSMS acknowledge alerts
Posted: Thu Nov 15, 2012 9:10 am
by BanditBBS
Well, I didn't have some of the perl modules installed. used cpan to install CGI::Carp, XML::Simple and Data::Dumper.
It still isn't working, but at least I have those installed. Still getting the internal server error if I call the cgi and in the logs on the sms device I am still getting the same errors I posted earlier. I'm not resting until I figure out what I am missing.
Re: iSMS acknowledge alerts
Posted: Thu Nov 15, 2012 9:23 am
by BanditBBS
Code: Select all
[Thu Nov 15 09:22:37 2012] [error] [client 10.96.26.50] (2)No such file or directory: exec of '/usr/local/smsack/bin/smsack.cgi' failed
[Thu Nov 15 09:22:37 2012] [error] [client 10.96.26.50] Premature end of script headers: smsack.cgi
That is what I am seeing in my httpd error_log. The file does exist, made it 777 just for testing purposes and headers look right to me.
Re: iSMS acknowledge alerts
Posted: Thu Nov 15, 2012 10:32 am
by BanditBBS
Just to update on my progress. I got past the error by adding a "-w" to the end of the first line, the /usr/bin/perl line.
Now my iSMS sends messages to to my nagios server and gets an OK back. The nagios server is not doing anything with the messages, don't think it likes what it is being sent. Still figuring it out, just updating anyone that may be following this thread.
Re: iSMS acknowledge alerts
Posted: Thu Nov 15, 2012 11:33 am
by BanditBBS
Mine is now working....as long as there is not a space in the host or service name. Trying to make sense of the code so I can hopefully fix that issue, then I'll be 100% satisfied.
Re: iSMS acknowledge alerts
Posted: Thu Nov 15, 2012 12:55 pm
by BanditBBS
Here is the part of the code getting the host and service name:
Code: Select all
# Grab the host name and service
my $alerttype = '';
my $host = '';
my $service = '';
if ($Message =~ m/\w+\s+(\w+)\s+\/\s+(\w+)/)
{
$alerttype = 'ServiceAlert' if $2 ne '';
$host = $1;
$service = $2;
I can't figure out how to change it to accoutn for spaces in host and or service names. For host name, just read until the "/" and service name read until the word "Problem" would work, but this is above my perl skill level. Hopefully the author can resolve.
Re: iSMS acknowledge alerts
Posted: Thu Nov 15, 2012 2:24 pm
by slansing
Awesome, did you ever get the following error?
Code: Select all
smsack.cgi: Use of uninitialized value $SenderNumber in pattern match (m//) at /usr/local/smsack/bin/smsack.cgi line 75.
Code: Select all
smsack.cgi: Use of uninitialized value $Message in pattern match (m//) at /usr/local/smsack/bin/smsack.cgi line 62.