I'm new to Cacti and have already searched the whole forum but can't find any solution for my SSH problem.
I'm trying to get disk space data from a remote-host using SSH and a perl script. All machines are running under linux.
If I call the command "/usr/bin/ssh root@aHost -C /usr/local/cacti/scripts/diskused.pl aPartition" at the shell, it returns the right values (total:12345678 used:23456789). Using Cacti the following can be read in my cacti.log:
"WARNING: Result from CMD not valid. Partial Result:
CMD: /usr/bin/ssh root@aHost -C /usr/local/cacti/scripts/diskused.pl /, output: U".
I've checked the Maximum Value of my Data Source Item, but it's big enough to hold the returned value.
Here's the perl script:
Code: Select all
#!/usr/bin/perl
$ret = `df --block-size=1024 -P $ARGV[0] | grep -v Filesystem`;
$ret =~ s/($ARGV[0])(.* )(.*[0-9])(.* )(.*[0-9])(.* )(.*[0-9])(.* )(.*[0-9])%(.* )//;
print "total:$3 used:$5";
Tnx in advance,
Thorinson