AnsweredAssumed Answered

Problem with EPA running a perl script

Question asked by vicen23 on Jan 14, 2016
Latest reply on Jan 15, 2016 by vicen23

Hi all, I have a problem trying to run an EPA agent with a perl script in Linux. If I run the script on the server, the output is correct:

 

/usr/bin/perl /apps/introscopeprod/configuration/scripts/fileSystemConn5.pl

<metric type="IntCounter" name="fileSystemConn5:/apps/tdi/" value="91" />

 

But when I try to run the same script with EPA agent, I have this message in log file:

 

1/14/16 05:44:34 PM CET [INFO] [EPAgent.EPAgent fileSystemConn5] Starting plugin 'fileSystemConn5'.

1/14/16 05:44:34 PM CET [ERROR] [EPAgent] Metric value from plugin 'Plugin fileSystemConn5' is invalid: For input string: ""

 

And here is the perl script I'm running:

 

########################################################################

# Introscope EPAgent Plugin Script

# fileSystemConn5 per machine

#

########################################################################

 

 

#import our modules

use FindBin;

use lib ("$FindBin::Bin", "$FindBin::Bin/lib/perl", "$FindBin::Bin/../lib/perl");

        

use Wily::PrintMetric;

 

 

my $fileSystemConn5Command1 = `df -k /apps/tdi/ | tail -1 | cut -d' ' -f 13 | cut -d'%' -f 1`;

 

 

      Wily::PrintMetric::printMetric( type        => 'IntCounter',

                                      resource    => 'fileSystemConn5',

                                      name        => '/apps/tdi/',

                                      value       => $fileSystemConn5Command1,

                                   );

 

 

Am I doing something wrong? does anyone have a similar problem?

 

Thanks a lot for your help, regards

 

Vicente

Outcomes