iSMS acknowledge alerts

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: iSMS acknowledge alerts

Post 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?
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: iSMS acknowledge alerts

Post 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 :)
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: iSMS acknowledge alerts

Post 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)
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: iSMS acknowledge alerts

Post 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 :)
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: iSMS acknowledge alerts

Post 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.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: iSMS acknowledge alerts

Post 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.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: iSMS acknowledge alerts

Post 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.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: iSMS acknowledge alerts

Post 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.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: iSMS acknowledge alerts

Post 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.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: iSMS acknowledge alerts

Post 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.
Locked