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;
}
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?