Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


CACTID: Poller[0] Host[1] ERROR: Empty result
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Cacti Forum Index -> Help: General
Author Message
gandalf
Developer


Joined: 02 Dec 2004
Posts: 12642
Location: Muenster, Germany

PostPosted: Tue Nov 11, 2008 4:14 pm    Post subject: Reply with quote

Are you using any OS commands in your script? May you please post the code?
Reinhard
Back to top
deu439356



Joined: 13 Aug 2008
Posts: 45

PostPosted: Tue Nov 11, 2008 4:23 pm    Post subject: Reply with quote

I am not using any OS commands.

values.txt File contains:
20
5
25


My Script (I am just printing out the first number from the file):

Code:
#!/usr/bin/perl

$stats = "./values.txt";

my $counter = 0;
my $result = "";
   @var = ();
open(STATFILE,"< $stats") or die "Can't open $stats for read:$!\n";

while ($line = <STATFILE>) {
   chop $line;
#   print "$line\n";
   $var[$counter] = $line;
   $counter++;
}

close(STATFILE);

print $var[0];



dataTemp.JPG
 Description:
 Filesize:  184.47 KB
 Viewed:  199 Time(s)

dataTemp.JPG



dataInput.JPG
 Description:
 Filesize:  132.28 KB
 Viewed:  200 Time(s)

dataInput.JPG


Back to top
gandalf
Developer


Joined: 02 Dec 2004
Posts: 12642
Location: Muenster, Germany

PostPosted: Wed Nov 12, 2008 3:47 pm    Post subject: Reply with quote

Please provide the full path the the data file and retry
Reinhard
Back to top
deu439356



Joined: 13 Aug 2008
Posts: 45

PostPosted: Wed Nov 12, 2008 3:48 pm    Post subject: Reply with quote

My apologies. I do have the full path in there. I had removed it for troubleshooting different possibilities. Currently the full path is present.
Back to top
deu439356



Joined: 13 Aug 2008
Posts: 45

PostPosted: Wed Nov 12, 2008 3:52 pm    Post subject: Reply with quote

I tried putting my script in the unix_users.pl script (since I am graphing that one), but I still get the errors. What is different between my output and the output from the unix_users script? They both return numbers... Here is the unix_users.pl script (this works, mine above doesn't).

Code:
#!/usr/bin/perl

my $grep_string = $ARGV[0];

chomp $grep_string;

if ($grep_string eq '') {
        open(PROCESS, "who | grep -c : |");
}else{
        open(PROCESS, "who | grep : | grep -c $grep_string |");
}
$output = <PROCESS>;
close(PROCESS);
chomp($output);
print $output;
Back to top
deu439356



Joined: 13 Aug 2008
Posts: 45

PostPosted: Wed Nov 12, 2008 4:42 pm    Post subject: Reply with quote

Gandalf,

I miss read your post. I thought you were talking about the path in the Data Input screen to the script. I put the full path in the script that points to my data file and that resolved my issue. Thank you for your time and helping me resolve this!
Back to top
gandalf
Developer


Joined: 02 Dec 2004
Posts: 12642
Location: Muenster, Germany

PostPosted: Wed Nov 12, 2008 5:11 pm    Post subject: Reply with quote

Ahh, I'm glad. I just tried all stuff and it worked for me.
CU
Reinhard
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Help: General All times are GMT - 5 Hours
Goto page Previous  1, 2
Page 2 of 2

 



Powered by phpBB © 2001, 2005 phpBB Group