parent
1015709880
commit
fc6d32923d
2 changed files with 23 additions and 0 deletions
@ -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…
Reference in new issue