how can i graph my temperature

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

Moderators: Developers, Moderators

Post Reply
lisa_parma
Posts: 18
Joined: Wed Jan 18, 2006 2:55 am
Location: indonesia
Contact:

how can i graph my temperature

Post by lisa_parma »

hi,all
sory if my English very bad
I’m beginner in using cacti

I have some problem in using cacti…

I’m using cacti to monitoring my netguardian temperature



when i use snmpwalk for the OID temperature, i get this value
.1.3.6.1.4.1.2682.1.2.2.1.5.99.1.10 = STRING: "........ 21.5035"




the real temperature is 21.5035 celsius
the problem here is when i run my snmpwalk for the OID temperature
i got value "........ 21.5035"
i dont understand, how can i get the real temperature value< 21.5035 not "........ 21.5035">

should I modify cacti’source code??
can you tell me where part of cacti's source code that I should modify???
cause I’m beginner too in using PHP

please help me
thx b4:)
paulbeard206
Cacti User
Posts: 150
Joined: Sat Jul 30, 2005 2:15 pm

try this

Post by paulbeard206 »

try

Code: Select all

snmpget -Ovq -c<community> -v<version> host IOD
Should get results like this:

Code: Select all

snmpget -Ovq localhost laLoad.1
0.12
instead of this:

Code: Select all

snmpget localhost laLoad.1
UCD-SNMP-MIB::laLoad.1 = STRING: 0.03
lisa_parma
Posts: 18
Joined: Wed Jan 18, 2006 2:55 am
Location: indonesia
Contact:

Post by lisa_parma »

i have try to do this

snmpget -v 1 -c public 10.2.4.66 .1.3.6.1.4.1.2682.1.2.2.1.5.99.1.10

the result is:
SNMPv2-SMII::enterprises.2682.1.2.2.1.5.99.1.10= STRING "........ 20.0425"

the real temperature value is just 20.0425

that i should modify cacti's source code?
paulbeard206
Cacti User
Posts: 150
Joined: Sat Jul 30, 2005 2:15 pm

no need to work on cacti's source

Post by paulbeard206 »

lisa_parma wrote:i have try to do this

snmpget -v 1 -c public 10.2.4.66 .1.3.6.1.4.1.2682.1.2.2.1.5.99.1.10

the result is:
SNMPv2-SMII::enterprises.2682.1.2.2.1.5.99.1.10= STRING "........ 20.0425"

the real temperature value is just 20.0425

that i should modify cacti's source code?
this has nothing to do with cacti: you're just using snmpget.

try

Code: Select all

snmpget -Oqn -v1 -cpublic 10.2.4.66 .1.3.6.1.4.1.2682.1.2.2.1.5.99.1.10
That should just return the numeric value you want. The Oqn options trim the results so you don't get extra stuff.

From there, you should be able to setup Cacti to query a single OID using that value (1.3.6.1.4.1.2682.1.2.2.1.5.99.1.10).
lisa_parma
Posts: 18
Joined: Wed Jan 18, 2006 2:55 am
Location: indonesia
Contact:

Post by lisa_parma »

i have try do this

snmpget -Oqn -c public -v 1 10.2.4.66 .1.3.6.1.4.1.2682.1.2.2.1.5.99.1.10
result:
.1.3.6.1.4.1.2682.1.2.2.1.5.99.1.10 "........ 20.1100"

and try this
snmpget -Ovq -c public -v 1 10.2.4.66 .1.3.6.1.4.1.2682.1.2.2.1.5.99.1.10
result:
"........ 20.0650"

and i have make my snmp_query in xml,i attach in NGD_temp3.xml
i have add that xml in cacati<data_query>

rrd file have generate but no data i have found

this is the return value in cacti log:
02/01/2006 01:31:02 PM - CMDPHP: Poller[0] Host[2] DS[35] WARNING: Result from CMD not valid. Partial Result:
02/01/2006 01:31:02 PM - CMDPHP: Poller[0] Host[2] DS[88] WARNING: Result from SNMP not valid. Partial Result: ........ 20.0875
02/01/2006 01:31:02 PM - CMDPHP: Poller[0] Host[2] DS[26] WARNING: Result from SNMP not valid. Partial Result:
02/01/2006 01:31:02 PM - CMDPHP: Poller[0] Host[2] DS[27] WARNING: Result from SNMP not valid. Partial Result:
02/01/2006 01:31:02 PM - CMDPHP: Poller[0] Host[2] DS[28] WARNING: Result from SNMP not valid. Partial Result:
02/01/2006 01:31:02 PM - CMDPHP: Poller[0] Host[2] DS[29] WARNING: Result from SNMP not valid. Partial Result:
02/01/2006 01:31:03 PM - CMDPHP: Poller[0] Host[2] DS[90] WARNING: Result from SNMP not valid. Partial Result:
02/01/2006 01:31:07 PM - SYSTEM STATS: Time:6.1497 Method:cmd.php Processes:1 Threads:N/A Hosts:6 HostsPerProcess:6 DataSources:39 RRDsProcessed:23

when i try to fecth my rrd file manually used rrdtool, like this;
c:\rrdtool\rrdtool fetch netguardian_temperature_88.rrd AVERAGE
return result like this:
Temperature

1138689900: NaN
1138690200: NaN
1138690500: NaN
1138690800: NaN
1138691100: NaN
1138691400: NaN
1138691700: NaN
1138692000: NaN
1138692300: NaN
1138692600: NaN
1138692900: NaN
1138693200: NaN
1138693500: NaN
1138693800: NaN
1138694100: NaN
1138694400: NaN
1138694700: NaN
1138695000: NaN
1138695300: NaN
1138695600: NaN
1138695900: NaN
Attachments
NGD_Temp3.xml
snmp query in xml
(952 Bytes) Downloaded 160 times
data_template n graph template.zip
data template and graph template
(7.47 KiB) Downloaded 123 times
gbr.jpg
gbr.jpg (47.88 KiB) Viewed 4013 times
User avatar
TheWitness
Developer
Posts: 17053
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Your snmp agent is returning bogus data from the query. If you can't get the vendor to correct their code, you best bet would be to write a PHP Script Server script to trim the non alpha characters off the front of the string. Or, I guess a little patch to cmd.php/cactid would also be acceptable since it does not return non-numeric data.

Could you please log a ticket to http://bugs.cacti.net and then post the bug number to this post. I will publish a patch. It may take a while. I live in Detroit and it's approaching Super Bowl weekend and I will be out of town next week.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
lisa_parma
Posts: 18
Joined: Wed Jan 18, 2006 2:55 am
Location: indonesia
Contact:

Post by lisa_parma »

TheWitness wrote: Could you please log a ticket to http://bugs.cacti.net and then post the bug number to this post. I will publish a patch. It may take a while. I live in Detroit and it's approaching Super Bowl weekend and I will be out of town next week.

TheWitness
i have log in to http://bugs.cacti.net

by the way...
i have try to change cacti'code
the cacti code that have i change is ./lib/snmp.php

i have add the red line
......
function format_snmp_string($string) {
/* strip off all leading junk (the oid and stuff) */
$string = trim(ereg_replace(".*= ?", "", $string));

/* remove ALL quotes */
$string = str_replace(""", "", $string);
$string = str_replace("'", "", $string);
$string = str_replace(">", "", $string);
$string = str_replace("<", "", $string);
$string = str_replace("", "", $string);
$string = str_replace("........", "", $string);
.....

my temperature graph is work<just return value 21.0956>
and my cacti.log say like this:
02/02/2006 04:41:06 PM - CMDPHP: Poller[0] Host[2] DS[35] WARNING: Result from CMD not valid. Partial Result:
02/02/2006 04:41:07 PM - CMDPHP: Poller[0] Host[2] DS[26] WARNING: Result from SNMP not valid. Partial Result:
02/02/2006 04:41:07 PM - CMDPHP: Poller[0] Host[2] DS[27] WARNING: Result from SNMP not valid. Partial Result:
02/02/2006 04:41:07 PM - CMDPHP: Poller[0] Host[2] DS[28] WARNING: Result from SNMP not valid. Partial Result:
02/02/2006 04:41:07 PM - CMDPHP: Poller[0] Host[2] DS[29] WARNING: Result from SNMP not valid. Partial Result:
02/02/2006 04:41:09 PM - SYSTEM STATS: Time:5.4001 Method:cmd.php Processes:1 Threads:N/A Hosts:5 HostsPerProcess:5 DataSources:31 RRDsProcessed:20
Attachments
gbr1.JPG
gbr1.JPG (44.61 KiB) Viewed 3968 times
User avatar
TheWitness
Developer
Posts: 17053
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

That works, but I have other ideas. Glad it's working for you. Thanks for the bug report.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
lisa_parma
Posts: 18
Joined: Wed Jan 18, 2006 2:55 am
Location: indonesia
Contact:

Post by lisa_parma »

TheWitness wrote:That works, but I have other ideas. Glad it's working for you. Thanks for the bug report.

TheWitness
what is your idea?

and for my cacti.log:
02/02/2006 04:41:06 PM - CMDPHP: Poller[0] Host[2] DS[35] WARNING: Result from CMD not valid. Partial Result:
02/02/2006 04:41:07 PM - CMDPHP: Poller[0] Host[2] DS[26] WARNING: Result from SNMP not valid. Partial Result:
02/02/2006 04:41:07 PM - CMDPHP: Poller[0] Host[2] DS[27] WARNING: Result from SNMP not valid. Partial Result:
02/02/2006 04:41:07 PM - CMDPHP: Poller[0] Host[2] DS[28] WARNING: Result from SNMP not valid. Partial Result:
02/02/2006 04:41:07 PM - CMDPHP: Poller[0] Host[2] DS[29] WARNING: Result from SNMP not valid. Partial Result:
02/02/2006 04:41:09 PM - SYSTEM STATS: Time:5.4001 Method:cmd.php Processes:1 Threads:N/A Hosts:5 HostsPerProcess:5 DataSources:31 RRDsProcessed:20

that is my cacti's work will not troubeled whit this?

how can i repair that?
thx b4 :)
User avatar
TheWitness
Developer
Posts: 17053
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Turn logging to DEBUG for one pass and you should be able to identify why the snmp and cmd scripts are not working for you. If you would like, you can post your results here. Remember to not leave DEBUG on though.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
lisa_parma
Posts: 18
Joined: Wed Jan 18, 2006 2:55 am
Location: indonesia
Contact:

Post by lisa_parma »

i have install SNMP Agent in my computer.....
and know my cacti.log say like this:

02/06/2006 01:21:03 PM - SYSTEM STATS: Time:2.1699 Method:cmd.php Processes:1 Threads:N/A Hosts:4 HostsPerProcess:4 DataSources:11 RRDsProcessed:6

but when my SNMP services cannot start...but the service didn't report an error.do you know why??

when i try to used polling type with cactid
my cacti.log report like this:
02/06/2006 01:11:03 PM - CACTID: Poller[0] Host[2] DS[8] WARNING: Result from SNMP not valid. Partial Result: ........ 19.9510...
02/06/2006 01:11:06 PM - SYSTEM STATS: Time:5.2623 Method:cactid Processes:1 Threads:1 Hosts:4 HostsPerProcess:4 DataSources:11 RRDsProcessed:6

this massage:
02/06/2006 01:11:03 PM - CACTID: Poller[0] Host[2] DS[8] WARNING: Result from SNMP not valid. Partial Result: ........ 19.9510...
appaer again????

please help me...
thx b4
Attachments
this is result when i run c:cactidcactid
this is result when i run c:cactidcactid
cactid.JPG (34.27 KiB) Viewed 3873 times
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Cactid does not use /lib/snmp.php. You must edit the cactid source file(s) and then recompile. I suggest you go back to cmd.php.
User avatar
TheWitness
Developer
Posts: 17053
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

This problem is associated with your snmp.conf file. Please, either delete that file or remove the entries that look similar to your error messages.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
lisa_parma
Posts: 18
Joined: Wed Jan 18, 2006 2:55 am
Location: indonesia
Contact:

Post by lisa_parma »

sory, i don't know what shoul i do...
this is content of my snmp.conf:
mibdirs C:/net-snmp/share/snmp/mibs
persistentDir C:/net-snmp/snmp/persist
tempFilePattern C:/net-snmp/temp/snmpdXXXXXX

and thisi is cacti.conf massage:
#
# net-snmp (or ucd-snmp) persistent data file.
#
# DO NOT STORE CONFIGURATION ENTRIES HERE.
# Please save normal configuration tokens for cactid in SNMPCONFPATH/cactid.conf.
# Only "createUser" tokens should be placed here by cactid administrators.
#

engineBoots 1
oldEngineID 0x800007e5802439c257c650e943
User avatar
TheWitness
Developer
Posts: 17053
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Remove all entries and then save the file.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests