string to integer without script

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

Moderators: Developers, Moderators

Post Reply
Jason.S
Posts: 35
Joined: Thu Jun 11, 2009 9:28 am

string to integer without script

Post by Jason.S »

Hello,

We have been fighting a MONSTER high load on our server, and to kill off some scripts, I need a way to do a string to integer.
Jason.S
Posts: 35
Joined: Thu Jun 11, 2009 9:28 am

Post by Jason.S »

Anyone?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: string to integer without script

Post by gandalf »

Jason.S wrote:Hello,

We have been fighting a MONSTER high load on our server, and to kill off some scripts, I need a way to do a string to integer.
What do you want to achieve? Is this Cacti-related?
R.
Jason.S
Posts: 35
Joined: Thu Jun 11, 2009 9:28 am

Post by Jason.S »

Hello sir,

It is cacti related. Our SU-ID-1D radios will give their RSSI in a octet string format. I need a way to take the string value and convert it to a number so that it can be graphed.


Thank you,
Jason
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Hmm, Larry recently fixed a hex conversion issue. Don't know, if octet conversion is in as well. You may want to pm him
R.
Jason.S
Posts: 35
Joined: Thu Jun 11, 2009 9:28 am

Post by Jason.S »

Is his Username Larry?
hardyk
Posts: 7
Joined: Wed Jan 14, 2009 3:15 am

Post by hardyk »

Hi All!

I have the same task as Jason have.
My snmp agent tooks data from SHELL script. But snmpwalk shows me that this data is represented as STRING (see 2.101.12).

Example:
snmpwalk -v2c -c 'comm_name' hostname .1.3.6.1.4.2
2.1.1 = 1
2.2.1 = "some text"
2.3.1 = "/usr/bin/sh /path/to/script.sh"
2.100.1 = 0
2.101.1 = "text description"
2.101.2 = "12"
2.102.1 = 0
2.103.1 = ""


The question is - is it possible to graph 2.101.12 as it is represented now or there is another way to configure snmpd.conf so snmp agent will send INTEGER data?

Gandalf and other CACTI Guru! I'm looking forward to your response.

Regards,
Pavel
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Jason.S wrote:Is his Username Larry?
He's TheWitness on the forum
R.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

hardyk wrote:...snmpwalk shows me that this data is represented as STRING (see 2.101.12).

Example:
snmpwalk -v2c -c 'comm_name' hostname .1.3.6.1.4.2
2.1.1 = 1
2.2.1 = "some text"
2.3.1 = "/usr/bin/sh /path/to/script.sh"
2.100.1 = 0
2.101.1 = "text description"
2.101.2 = "12"
2.102.1 = 0
2.103.1 = ""
There is no 2.101.12 in your example. A typo? Cacti does not care about types. Passing a string representation of a number is fine. But Cacti assumes the number to be base10 and not base8 or whatever you may imagine.
R.
hardyk
Posts: 7
Joined: Wed Jan 14, 2009 3:15 am

Post by hardyk »

Gandalf, thank you!

Yes,it's a typo! I meant 2.101.2 with value "12"
I'll try to graph this OID, however, it's still unsucessfull for me :(
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please see 2nd link of my sig to see what cacti receives and how it handles the data. Which version of Cacti are you running? Are you using spine?
R.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests