Add discovery script and conf for nut ups

tags/zabbix-agent-addons-0.2.20-1 0.1.4
Daniel Berteaud 11 years ago
parent 1015709880
commit fc6d32923d
  1. 6
      zabbix_conf/nut_ups.conf
  2. 17
      zabbix_scripts/disco_nut_ups

@ -30,3 +30,9 @@ UserParameter=ups.status[*],upsc $1 ups.status
# Key: ups.model[UPS]
# Type of information: Text
UserParameter=ups.model[*],upsc $1 ups.model
# UPS discovery
UserParameter=hardware.ups.discovery[*],/var/lib/zabbix/bin/disco_nut_ups $1
# This is a new, more generic nut ups UserParameter
UserParameter=hardware.ups[*],upsc $1 $2

@ -0,0 +1,17 @@
#!/usr/bin/perl -w
use JSON;
my $json;
if (system("upsc -l >/dev/null 2>&1") == 0){
foreach my $ups (`upsc -l`){
chomp($ups);
push @{$json->{data}}, {"{#UPSNAME}" => $ups};
}
print to_json($json) if (defined $json->{data});
}
else{
print 'ZBX_NOTSUPPORTED';
}
exit(0);
Loading…
Cancel
Save