Additional scripts for Zabbix agent on Linux to discover and monitor several services
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
package Zabbix::Agent::Addons::UPS;
|
|
|
|
|
|
|
|
use warnings;
|
|
|
|
use strict;
|
|
|
|
use File::Which;
|
|
|
|
use File::Spec;
|
|
|
|
open STDERR, '>', File::Spec->devnull() or die "could not open STDERR: $!\n";
|
|
|
|
|
|
|
|
# List configured UPS (only nut is supported)
|
|
|
|
sub list_ups {
|
|
|
|
my @ups = ();
|
|
|
|
my $upsc = which('upsc');
|
|
|
|
if ($upsc && -x $upsc){
|
|
|
|
my @out = qx($upsc -l);
|
|
|
|
if ($? == 0){
|
|
|
|
@ups = @out;
|
|
|
|
chomp @ups;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return @ups;
|
|
|
|
};
|
|
|
|
|
|
|
|
1;
|