Hi all,
I'm trying to get a perl script working and having a little trouble. If anyone knows of the Xymon monitoring tool, this is a server side script that I am working on.
I'm looking to check the Xymon client data to see if a partcular service is running but I can seem to get the if to work.
It's always dropping through to the "else" section whether "service.exe" is in $sections{"procs"} or not.
Any help would be very much appreciated.
This is the particular piece of code,
if ( $sections{"procs"} !~ m/service.exe/ ) {
$color = "yellow";
$summary = "`/bin/date` CAWA Server service is not run
+ning.";
$statusmsg = "&yellow service.exe not running. Possibl
+e failover to ukclasce002. Inform OSG before 8:30am.\n\n" . $s
ections{"procs"};
}
else {
$color = "green";
$summary = "`/bin/date` CAWA Server service OK $os";
$statusmsg = "&green service.exe running ok.\n\n" . $s
+ections{"procs"};
}
and this is that data contained in $sections{"procs"}
PID Name
0 Idle
4 System
352 smss.exe
400 csrss.exe
424 winlogon.exe
472 services.exe
484 lsass.exe
644 vmacthlp.exe
684 svchost.exe
752 svchost.exe
816 svchost.exe
840 svchost.exe
856 svchost.exe
996 spoolsv.exe
1196 cagent32.exe
1228 xferwan.exe
1252 svchost.exe
1400 FrameworkService.exe
1832 sqlservr.exe
1868 svchost.exe
1916 sqlwriter.exe
2076 VMwareService.exe
2156 VMUpgradeHelper.exe
2208 tlmagent.exe
2320 wmiprvse.exe
2948 svchost.exe
3380 dllhost.exe
3812 wmiprvse.exe
4040 svchost.exe
2972 lpx86.exe
9900 mfevtps.exe
7904 mcshield.exe
7984 VsTskMgr.exe
4912 mfeann.exe
7112 naPrdMgr.exe
9348 explorer.exe
3176 VMwareTray.exe
3656 VMwareUser.exe
9988 UdaterUI.exe
6696 VProTray.exe
8868 ctfmon.exe
8296 WindowsSearch.exe
6656 McTray.exe
5476 VProSvc.exe
8316 SymSnapService.exe
3292 logon.scr
7876 csrss.exe
360 winlogon.exe
180 rdpclip.exe
9580 explorer.exe
1368 VMwareTray.exe
1512 VMwareUser.exe
6440 VProTray.exe
1332 shstat.exe
1552 ctfmon.exe
140 WindowsSearch.exe
5284 mmc.exe
9324 mmc.exe
8872 BBWin.exe
9712 service.exe