Creating multiple values scripts

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
alianos
Posts: 6
Joined: Thu Jan 11, 2007 6:59 am

Creating multiple values scripts

Post by alianos »

Hi,
I have written a php script that ends with the following line


echo "e:".$row_e['e']."\np:".$row_p['p']."\nd:".$row_d['d'];

and that prints something like

e:9154
p:0
d:24510

I go to Data Input Methods, add a new one and give it 3 outputs named d,e and p. (i have tried the data source both like "Script/Command" and "script - script server PHP")

Then I go to Data Sources, where I add 3 data source items.
-If the data source is Script/command, I can choose what Data Source Item is what output.
-If the Data source is script - script server PHP, I cant choose that, I just make 3 Data Source Items.

On both cases, nothing shows up when i try to grapth it, and no error messages are displayed anywhere.

Any guidelines where to move next and what is the correct setup? cheers.
alianos
Posts: 6
Joined: Thu Jan 11, 2007 6:59 am

Post by alianos »

I have tried to edit the exit to many ways.

e:9154 p:0 d:24511alianos@nocusers
doesnt work also, should I add a /n at the end?

Also what makes me wonder most is the fact that I cannot choose what Data Source Item is supposed to be each Output. Here is a SS.
Attachments
output_problem.JPG
output_problem.JPG (99.44 KiB) Viewed 2328 times
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please find help on creating scripts for cacti at the very fist link of my signature
Reinhard
User avatar
sizulku
Cacti User
Posts: 110
Joined: Mon Nov 04, 2002 9:15 am
Location: ACEH
Contact:

Post by sizulku »

Is there any error in cacti log file? I've php script that has similiar output like yours but I use Script/command in Data Sources.
alianos
Posts: 6
Joined: Thu Jan 11, 2007 6:59 am

Post by alianos »

I am sorry to say that there is nothing i could find in your first link to help me with this problem.

the script runs, the outputs are in the form its required. No errors are displayed. However, no graph.
mvam
Cacti User
Posts: 87
Joined: Wed Jun 01, 2005 2:00 pm
Location: Seattle

Post by mvam »

the names in your output should match the internal data source name in your template.
alianos
Posts: 6
Joined: Thu Jan 11, 2007 6:59 am

Post by alianos »

I wasnt even using a template, I was going from data input method to data source as I was doing with the rest of my scripts.

I'll give it a try and let you know, cheers.
alianos
Posts: 6
Joined: Thu Jan 11, 2007 6:59 am

Post by alianos »

On command line I type

php nisides.php and that generates

e:9244 p:3 d:25521

name Nisides
I go to "Data Input Methods" create a new one
Input type -> script/command
Input String ->php <path_cacti>/scripts/nisides.php

Input Fields
No Input Fields

Output Fields
Name Field Order Friendly Name Update RRA
d 0 (Not In Use) disabled Selected Delete
e 0 (Not In Use) energopoiimeno Selected Delete
p 0 (Not In Use) pending Selected Delete





When thats done I go to data templates, create a new one
Name Nisides
Data Input Method Nisides

1: d 2: e 3: p
Internal Data Source Name d
Output Field d - disabled (from the dropdown list)

and similar for e and p

Then I go and graph the values, the graph is generated with no errors, but no line is apearing. (seems like there are no values in the database)
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please click the graph and select the wrench, then. Post the whole "rrdtool graph" statement found
Reinhard
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests