Page 3 of 3

Re: iSMS acknowledge alerts

Posted: Thu Nov 15, 2012 4:48 pm
by BanditBBS
Here is the fixed part of the code:

Code: Select all

if ($Message =~ m/\w+\s+(\w+)\s+\/\s+([\w\s]+)/){
        $alerttype = 'ServiceAlert' if $2 ne '';
        $host      = $1;
        $service   = $2;
        $service =~ s/[A-Z]{2,}.$//;
        $service =~ s/\s+$//;
}elsif ($Message =~ m/\w+\s+(\w+)/){
        $alerttype = 'HostAlert';
        $host   =$1;
}
That fixes the code for spaces in service names.

No, i never received any of those errors. Once I got the script to run(installed missing perl mods) my other error was I had no pager number in my contact. Once I added that in, i was then able to test and it wasn't working because of spaces in service name. I then tried without a space and it worked fine and I knew the issue was then with the code and services with spaces in them.

So now my last question is, anyway I can grab the number from the iSMS configuration for users and copy that to the pager variable?

Re: iSMS acknowledge alerts

Posted: Thu Nov 15, 2012 5:12 pm
by slansing
Hmm, odd, I'm going to try to do this all over again some day when I have more time. Or more documentation is created, whichever comes first :)

Re: iSMS acknowledge alerts

Posted: Fri Nov 16, 2012 10:26 am
by BanditBBS
slansing wrote:Hmm, odd, I'm going to try to do this all over again some day when I have more time. Or more documentation is created, whichever comes first :)
Well, I have attached my version of instructions(listing credit to original author of course). really not many changes except listing out the pre-reqs and including the script in the doc with my modifications.

I just installed on a second NagiosXI server and second iSMS appliance. The XI server is a manual install bare minimum RHEL install. I wrote the instructions as I performed the install to make sure I didn't miss anything.

Re: iSMS acknowledge alerts

Posted: Fri Nov 16, 2012 10:28 am
by BanditBBS
slansing wrote: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.
I was getting some odd items in my httpd error log during my second install. It was with the test data I was using. If the information is not configured in your Nagios install, then you will receive some of those types of errors.

Re: iSMS acknowledge alerts

Posted: Fri Nov 16, 2012 3:03 pm
by slansing
Looks good, I will test this shortly.