output: ::::::::::::::

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
ranmakun
Posts: 7
Joined: Fri Dec 02, 2005 3:01 pm

output: ::::::::::::::

Post by ranmakun »

Hi, I have the following problem, I have a script that is running from a cron job that is creating a file with info about ping statics:

Code: Select all

min:201.033 avg:208.645 max:256.645 mdev:13.300 pktloss:0
I want to get this info from a script and input it to cacti, I've made several scripts to do this, with echo, printf, etc. None of them work and give the following output in the log:

Code: Select all

12/07/2005 08:10:04 PM - CMDPHP: Poller[0] Host[0] DS[49] CMD: /pathtoscript/ping.sh, output: ::::::::::::::
The scripts called from cacti are something like:

Code: Select all

#!/bin/bash
printf "`/bin/more /home/sites/kaori.com.ar/data/pinggoogle`"
But I get that output and I don't understand what's wrong. Any ideas?
Thank you.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Not really sure, but...
Try to debug the script. Replace the printf command for the file by printing some constant values.
But you might even try http://forums.cacti.net/viewtopic.php?t=10049 for your ping test.
Reinhard
ranmakun
Posts: 7
Joined: Fri Dec 02, 2005 3:01 pm

Post by ranmakun »

lvm wrote:Not really sure, but...
Try to debug the script. Replace the printf command for the file by printing some constant values.
But you might even try http://forums.cacti.net/viewtopic.php?t=10049 for your ping test.
Reinhard
Well thank you for the reference, but I wanted my own ping test, with some particular tests I didn't find in other scripts. And I wanted to know what was happening because I will make other scripts too.
While the bash script of my first post didn't work and produced the output I mentioned, the following script does work, although I don't see any difference in their outputs.

Code: Select all

#!/usr/bin/perl

open(DATA, "/path-to-data/pinggoogle");
@data = <DATA>;
printf @data;
close(DATA);
I still would like to know what the problem is, if someone figures it out.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

I'm using several shell scripts as well. So I'm sure it works. A common mistake is to use commands without supplying full path. This is needed as the poller runs from crontab...
Reinhard
ranmakun
Posts: 7
Joined: Fri Dec 02, 2005 3:01 pm

Post by ranmakun »

lvm wrote:I'm using several shell scripts as well. So I'm sure it works. A common mistake is to use commands without supplying full path. This is needed as the poller runs from crontab...
Reinhard
Yes, I tried supplying full path, that's the first thing I thought about, but it doesn't seem to be related to that.
Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests