string to integer without script
Moderators: Developers, Moderators
string to integer without script
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.
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.
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Re: string to integer without script
What do you want to achieve? Is this Cacti-related?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.
R.
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
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
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
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.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 = ""
R.
Who is online
Users browsing this forum: No registered users and 1 guest