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.
18 lines
304 B
18 lines
304 B
12 years ago
|
#!/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);
|