Process (Count & Memory) Monitoring on Windows & Unix Systems

Detailed Process Monitoring on Windows & Unix hosts via SNMP

USAGE: ./checkProcessesviaSNMP.sh <community-string> <remote-host> <process-names> <warning> <critical> <type> <MemUsage>
./checkProcessMemoryviaSNMP.sh public 127.0.0.1 httpd 20 30 up Alert if process count goes above thresholds.

./checkProcessMemoryviaSNMP.sh public 127.0.0.1 httpd  30  20  down Alert if process count falls below thresholds.

./checkProcessMemoryviaSNMP.sh public 127.0.0.1 httpd  2,10%  2,15%  up MemUsage Alert on UP-Count and Memory Usage.

./checkProcessMemoryviaSNMP.sh public 127.0.0.1 httpd  30,10% 20,30%  down MemUsage Alert on DOWN-Count and Memory Usage.

./checkProcessMemoryviaSNMP.sh public 127.0.0.1 httpd  10% 15% MemUsage Alert on just the Memory Usage of Processes.

MemUsage - Alert when the memory usage of processes found matching the user-specified pattern is x% of installed memory!
$ 
$ time ./checkProcessMemoryviaSNMP.sh k!nglAZy usrccfasxmg.americas.kinglazy.dev 'sqlserv' 5 1 down
WARNING: [ 2 ] running [ sqlserv ] process(es). Memory.Used = [ 115.133MB ]. Installed Memory = [ 7.999GB ]. PCT used by process(es) = [ 1.406% ]. Threshold = [ W=5 / C=1 ]. System.INFO = [ Hardware: Family 6 Model 37 Stepping 1 AT/AT COMPATIBLE - Software: Windows Version 5.2 (Build 3790 Multiprocessor Free) ].

real    0m0.15s
user    0m0.02s
sys     0m0.01s
$ 
$ 
$ 
$ time ./checkProcessMemoryviaSNMP.sh k!nglAZy usrccfasxmg.americas.kinglazy.dev 'sqlserv' 1 2 up
CRITICAL: [ 2 ] running [ sqlserv ] process(es). Memory.Used = [ 115.133MB ]. Installed Memory = [ 7.999GB ]. PCT used by process(es) = [ 1.406% ]. Threshold = [ W=1 / C=2 ]. System.INFO = [ Hardware: Family 6 Model 37 Stepping 1 AT/AT COMPATIBLE - Software: Windows Version 5.2 (Build 3790 Multiprocessor Free) ].

real    0m0.14s
user    0m0.02s
sys     0m0.02s
$ 
$
$ 
$ time ./checkProcessMemoryviaSNMP.sh k!nglAZy usrccdbp01gapw.americas.unixautomation.com 'sqlserv' 1,0.20% 2,0.3% up MemUsage
CRITICAL: [ 2 (critical) ] running [ sqlserv ] process(es). Memory.Used = [ 115.133MB (critical) ]. Installed Memory = [ 7.999GB ]. PCT used by process(es) = [ 1.406% (critical) ]. Threshold = [ W=1 / C=2 ]. System.INFO = [ Hardware: Family 6 Model 37 Stepping 1 AT/AT COMPATIBLE - Software: Windows Version 5.2 (Build 3790 Multiprocessor Free) ].

real    0m0.18s
user    0m0.03s
sys     0m0.03s
$ 
$ 
$ time ./checkProcessMemoryviaSNMP.sh k!nglAZy usrccdbp01gapw.americas.unixautomation.com 'sqlserv' 1,0.20% 1,0.3% down MemUsage
CRITICAL: [ 2 (ok) ] running [ sqlserv ] process(es). Memory.Used = [ 115.133MB (critical) ]. Installed Memory = [ 7.999GB ]. PCT used by process(es) = [ 1.406% (critical) ]. Threshold = [ W=1 / C=1 ]. System.INFO = [ Hardware: Family 6 Model 37 Stepping 1 AT/AT COMPATIBLE - Software: Windows Version 5.2 (Build 3790 Multiprocessor Free) ].

real    0m0.18s
user    0m0.02s
sys     0m0.02s
$