[SOLVED] Graph with 0.00 value...I followed the guide.

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

Moderators: Developers, Moderators

Post Reply
giropizza
Posts: 11
Joined: Wed Sep 23, 2009 5:28 am

[SOLVED] Graph with 0.00 value...I followed the guide.

Post by giropizza »

I have a Qnap (Linux Nas) that draw correctly many graphs.
I wanted to add a n HDD Temperature graph but after 3 days I need help.
I use Cacti Version 0.8.7g

I created a php script

Code: Select all

#! /mnt/ext/opt/apache/bin/php -q
<?php
  $HdTemp1=shell_exec('snmpwalk -t 5 -Os -c public -v2c localhost:11161 .1.3.6.1.4.1.24681.1.2.11.1.3.1|cut -d" " -f4|cut -c2-5');
  $HdTemp2=shell_exec('snmpwalk -t 5 -Os -c public -v2c localhost:11161 .1.3.6.1.4.1.24681.1.2.11.1.3.2|cut -d" " -f4|cut -c2-5');
  $HdTemp3=shell_exec('snmpwalk -t 5 -Os -c public -v2c localhost:11161 .1.3.6.1.4.1.24681.1.2.11.1.3.3|cut -d" " -f4|cut -c2-5');
  $HdTemp4=shell_exec('snmpwalk -t 5 -Os -c public -v2c localhost:11161 .1.3.6.1.4.1.24681.1.2.11.1.3.4|cut -d" " -f4|cut -c2-5');

print "hdt1:".trim($HdTemp1)." hdt2:".trim($HdTemp2)." hdt3:".trim($HdTemp3)." hdt4:".$HdTemp4;
?>
and the output is:

Code: Select all

hdt1:49 hdt2:50 hdt3:49 hdt4:49
I created the Data Input Method:
data_input.png
data_input.png (45.82 KiB) Viewed 2394 times
I created a Data Template in this way:
data_template.png
data_template.png (91.84 KiB) Viewed 2394 times
I created a Graph Template:
graph template.png
graph template.png (101.59 KiB) Viewed 2394 times
And the finally I create the graph
graph.png
graph.png (129.38 KiB) Viewed 2394 times
But always show 0.00
What I'm doing wrong???

Thanks in advance
Last edited by giropizza on Mon Aug 29, 2011 3:45 am, edited 1 time in total.
giropizza
Posts: 11
Joined: Wed Sep 23, 2009 5:28 am

Re: Graph with 0.00 value...I followed the guide step by ste

Post by giropizza »

Update: Looking in the cacti log (DEBUG Mode) I saw this error:
WARNING: Result from CMD not valid. Partial Result: hdt1: hdt2: hdt3: hd

I search on the forum and some people said that the solution could be check the privileges or check the correct path.

So I set 755 the permission of all scripts (but in crontab the poller is launched by root)
and recheck the paths, I used:
- absolute paths
- the <> paths notation for the cacti paths
- absolute paths also for the interpreter

Every time I rebuild the poller cache but with no solution.
Besides I tried one of the preinstalled scripts (the perl load average) and it gives the same error.
What I have to check now?

Thanks in advance
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: Graph with 0.00 value...I followed the guide step by ste

Post by noname »

giropizza wrote: So I set 755 the permission of all scripts (but in crontab the poller is launched by root)
and recheck the paths, I used:
- absolute paths
- the <> paths notation for the cacti paths
- absolute paths also for the interpreter
If you execute your script from cron as same as poller does, what do you see in the results?
For example:
*/5 * * * * php /share/Qweb/cacti/poller.php > /dev/null 2>&1
*/5 * * * * php /share/Qweb/cacti/scripts/hdd_temp.php >> /tmp/hdd_temp.log 2>&1
BTW: If the temperature is not cumulative value, you should use "GAUGE" (not "COUNTER") in data template.
giropizza
Posts: 11
Joined: Wed Sep 23, 2009 5:28 am

Re: Graph with 0.00 value...I followed the guide step by ste

Post by giropizza »

Ok, I found an error (snmpwalk needs the entire path).
Now I can see a line but it's always at 0.00 and with rrdtool I can se that the last.value seems fine (49)
I have to delete the rra file?
Besides I change counter to gauge, I have to recreate something?

Thanks in advance
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: Graph with 0.00 value...I followed the guide step by ste

Post by noname »

>> I have to delete the rra file?
>> Besides I change counter to gauge, I have to recreate something?

Yes, even if you changed settings in data template, it doesn't affect existing RRD files.
You should delete it (=RRD file) and wait until next polling.
giropizza
Posts: 11
Joined: Wed Sep 23, 2009 5:28 am

Re: Graph with 0.00 value...I followed the guide step by ste

Post by giropizza »

Ok, a recreate the graph and so on (after changing the template)
and looking in the rrd file I see that:

Code: Select all

ds[hdt1].type = "GAUGE"
ds[hdt1].minimal_heartbeat = 600
ds[hdt1].min = 0.0000000000e+00
ds[hdt1].max = 1.0000000000e+02
ds[hdt1].last_ds = "49"
ds[hdt1].value = 5.1070490100e+02
ds[hdt1].unknown_sec = 35
ds[hdt2].type = "GAUGE"
ds[hdt2].minimal_heartbeat = 600
ds[hdt2].min = 0.0000000000e+00
ds[hdt2].max = 1.0000000000e+02
ds[hdt2].last_ds = "49"
ds[hdt2].value = 5.1070490100e+02
ds[hdt2].unknown_sec = 35
ds[hdt3].type = "GAUGE"
ds[hdt3].minimal_heartbeat = 600
ds[hdt3].min = 0.0000000000e+00
ds[hdt3].max = 1.0000000000e+02
ds[hdt3].last_ds = "48"
ds[hdt3].value = 5.0028235200e+02
ds[hdt3].unknown_sec = 35
ds[hdt4].type = "GAUGE"
ds[hdt4].minimal_heartbeat = 600
ds[hdt4].min = 0.0000000000e+00
ds[hdt4].max = 1.0000000000e+02
ds[hdt4].last_ds = "48"
ds[hdt4].value = 5.0028235200e+02
ds[hdt4].unknown_sec = 35
All seem right now, thank you very much, the problem is that qnap has a custom linux that every reboot reset any customization (one of them was the PATH variable in which I had the snmpwalk executable)
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: Graph with 0.00 value...I followed the guide step by ste

Post by noname »

giropizza wrote:the problem is that qnap has a custom linux that every reboot reset any customization (one of them was the PATH variable in which I had the snmpwalk executable)
Though I had never used QNAP appliances, how about this?
- Install Optware IPKG -- Fix the $PATH in /etc/profile
giropizza
Posts: 11
Joined: Wed Sep 23, 2009 5:28 am

Re: [SOLVED] Graph with 0.00 value...I followed the guide.

Post by giropizza »

I know, I've forgotten to change the autorun, now it's ok.

Thanks
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests