check_mk local FPS script
Posted: Mon Oct 20, 2014 11:31 am
If anyone is running a check_mk agent on their zm server here's a no frills script to monitor the frame rate from each configured monitor.
You'll need to change the camera names and id #'s to fit your setup, and the login/password that zmu will use. Place it in /usr/lib/check_mk_agent/local/ or wherever your agent wants to see local scripts.
Probably not the best idea to put the username & password in there, if there's a way to get the info without that I'd be interested in a tip.
Code: Select all
#!/usr/bin/perl
# Get zoneminder monitor frame rates
push @camarray, (
{ camname => "Back", camid => "10" },
{ camname => "Back-low", camid => "11" },
{ camname => "Fence", camid => "12" },
{ camname => "Front", camid => "1" },
{ camname => "Front-low", camid => "2" },
{ camname => "Garage", camid => "5" },
{ camname => "Garage-low", camid => "6" },
{ camname => "Side", camid => "3" },
{ camname => "Side-low", camid => "4" },
{ camname => "Workshop", camid => "7" },
{ camname => "Workshop-low", camid => "8" },
{ camname => "Workshop-int", camid => "15" },
{ camname => "Gates", camid => "14" },
);
foreach $cam (@camarray) {
$fps = `zmu -m $cam->{camid} -f -Uusername -Ppassword`;
chomp $fps;
print "0 ZM_$cam->{camname} fps=$fps $cam->{camname} ($cam->{camid}) running at $fps FPS.\n";
}
Probably not the best idea to put the username & password in there, if there's a way to get the info without that I'd be interested in a tip.