Problems with custom script

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

Moderators: Developers, Moderators

Post Reply
breakintheweb
Posts: 7
Joined: Wed May 17, 2006 9:37 pm

Problems with custom script

Post by breakintheweb »

I wrote a custom script that outputs the following

Baseboard_Temp:25
FntPnl_Amb_Temp:17
Power_Cage_Temp:27
Processor1_Temp:22

I created a datasource using my custom script but am unable to get the rra file to create. I've read the manual, that refers to this process but am still unable to get it working. Can any one point me in the right direction?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

First, all output parms must be on the same print statement, no CR/LF. Second, follow the second to last link of my signature for a walkthrough of the steps that should be performed to get this up and running
Reinhard
breakintheweb
Posts: 7
Joined: Wed May 17, 2006 9:37 pm

Post by breakintheweb »

I changed my data output to:

Baseboard_Temp:26 FntPnl_Amb_Temp:16 Power_Cage_Temp:27 Processor1_Temp:22

the rra and graph is being created but the values are nan. Also, can cacti automap the value such as names (Baseboard_Temp) when polling.? Every cacti example i've see so far inputs values only and the values then get mapped to names through the cacti interface.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Mapping to rrd data sources is done by the definitions made for your Data Template (as described in my howto. If it is not clear enough, please give me a hint about the missing info to improve it). When running in DEBUG mode, the poller logs it (search for "map" in ./log/cacti.log)
If in doubt, please post a screenshot of the lower part of the Data Template
Reinhard
breakintheweb
Posts: 7
Joined: Wed May 17, 2006 9:37 pm

Post by breakintheweb »

I'm confused about the "use data-source value" is this how i get cacti to use the ds name from the script output?

I turned on log debugging and the below is what is said for my data gathering.

05/18/2006 04:53:53 PM - CMDPHP: Poller[0] Host[4] No host availability check possible for '192.168.0.5'.
05/18/2006 04:53:53 PM - CMDPHP: Poller[0] Host[4] DS[29] CMD: /var/www/html/scripts/check_ipmi.php 192.168.0.5, output: Baseboard_Temp:26 FntPnl_Amb_Temp:17 Power_Cage_Temp:27 Processor1_Temp:23

Once again, thanks for your help
Attachments
data_template.JPG
data_template.JPG (62.38 KiB) Viewed 2319 times
Graph is all nan
Graph is all nan
graph.JPG (35.71 KiB) Viewed 2319 times
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

The script seems to be ok. But the Data Template does not map your script, in not a single data source.
Please build a new Data Template. Name it IPMI Template or the like. Choose Data Input Method = YOur script.
Name the first data source like the first output parm of your script and select the same from the Output Field dropdown. Now select New to create a new data source. Enter the second output parms name as a data source name and select again the appr. Output Field. Repeat this for the last two output parms. All in alll, that's the procedure described in my howto, but repeated for all 4 output parms.
Now create the Graph Template referring to the newly created data sources. Again, refer to my howto but repeat the procedure for all of the 4 output parms.
BTB: You did discover the already existing IPMI Templates in the Scripts and Templates Forum?
Reinhard
breakintheweb
Posts: 7
Joined: Wed May 17, 2006 9:37 pm

Post by breakintheweb »

I have taken a look at the posted ipmi script but it was extremely slow and i couldn't get it to work in cacti. I plan on releaseing my script here one it works :)

I redid everything and now the rrd file isn't creating.

I really don't understand what i'm missing?
Attachments
Database template baseboard_temp
Database template baseboard_temp
data_template_baseboard.JPG (45.62 KiB) Viewed 2307 times
graph_template.JPG
graph_template.JPG (66.03 KiB) Viewed 2307 times
I should have for output fields since their are four temperature sensors?
I should have for output fields since their are four temperature sensors?
data_input_method.JPG (59.41 KiB) Viewed 2308 times
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Well, this looks by far better now. Took a time to figure out, what the TEMPx would relate to.
Next step: Please check the host's status when looking at the Device list. Should be up. And when editing the host, no red SNMP error should be seen. Please confirm both to proceed to the next debugging step.
Reinhard
breakintheweb
Posts: 7
Joined: Wed May 17, 2006 9:37 pm

Post by breakintheweb »

The host is up under devices (i'm using icmp for downed host detection) when i click on the host i get a red SNMP not in use
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

As I don't know anything about your script: Does it use SNMP? Or do you intend to use SNMP for the target in question? If not, leave the community string of that host's definition empty. I suppose you already did so.
Then, please login as cactiuser and run the

Code: Select all

php poller.php
manually from cacti's directory. Watch out for errors. You may switch Settings->Logging Level to DEBUG for one polling cycle and rerun the poller manually. Please post your findings
Reinhard
breakintheweb
Posts: 7
Joined: Wed May 17, 2006 9:37 pm

Post by breakintheweb »

THe script runs fine from the console. I have cacti running as root and the script set to 777 just to make sure.

[root@localhost scripts]# ./check_ipmi.php
Baseboard_Temp:26 FntPnl_Amb_Temp:17 Power_Cage_Temp:27 Processor1_Temp:23 [root@localhost scripts]#


05/19/2006 03:20:03 PM - CMDPHP: Poller[0] Host[4] DS[36] CMD: /var/www/html/scripts/check_ipmi.php 192.168.0.5, output: Baseboard_Temp:26 FntPnl_Amb_Temp:16 Power_Cage_Temp:27 Processor1_Temp:22
05/19/2006 03:20:03 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "insert into poller_output (local_data_id,rrd_name,time,output) values (36,'Processor1_Temp','2006-05-19 15:20:01','Baseboard_Temp:26 FntPnl_Amb_Temp:16 Power_Cage_Temp:27 Processor1_Temp:22')"
05/19/2006 03:20:03 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "delete from poller_output where local_data_id='36' and rrd_name='Processor1_Temp' and time='2006-05-19 15:20:01'"
05/19/2006 03:20:03 PM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /var/www/html/rra/awprad1_baseboard_temp_36.rrd --template Processor1_Temp 1148066401:U
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Umm, if your script is outputting: Baseboard_Temp, FntPnl_Amb_Temp, Power_Cage_Temp, Processor1_Temp, then those are the names you should be using in the data input methods Output fields. Cacti is looking for "temp1" etc which of course your script doesn't output.
breakintheweb
Posts: 7
Joined: Wed May 17, 2006 9:37 pm

Post by breakintheweb »

Hey it works!

Thanks alot..
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests