HaProxy statistics

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

hankycheng
Posts: 7
Joined: Fri May 21, 2010 10:49 pm

Re: HaProxy statistics

Post by hankycheng »

Hi

I have added script then check snmp using "snmpbulkwalk" but show Permission denied, here is screencap.

Code: Select all

[root@localhost test]# snmpbulkwalk -c abc -v2c 192.168.1.2 .1.3.6.1.4.1.2021.83
UCD-SNMP-MIB::ucdavis.83.1.1 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.83.2.1 = STRING: "/bin/bash"
UCD-SNMP-MIB::ucdavis.83.3.1 = STRING: "/test/haproxy.sh"
UCD-SNMP-MIB::ucdavis.83.100.1 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.83.101.1 = STRING: "/test/haproxy.sh: Permission denied"
UCD-SNMP-MIB::ucdavis.83.102.1 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.83.103.1 = ""
My NET-SNMP version: 5.3.2.2

any idea?
Many tks!
BWare
Posts: 33
Joined: Thu Jun 12, 2003 4:57 am
Location: Amsterdam
Contact:

Re: HaProxy statistics

Post by BWare »

hankycheng wrote:Hi

I have added script then check snmp using "snmpbulkwalk" but show Permission denied, here is screencap.

Code: Select all

[root@localhost test]# snmpbulkwalk -c abc -v2c 192.168.1.2 .1.3.6.1.4.1.2021.83
UCD-SNMP-MIB::ucdavis.83.1.1 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.83.2.1 = STRING: "/bin/bash"
UCD-SNMP-MIB::ucdavis.83.3.1 = STRING: "/test/haproxy.sh"
UCD-SNMP-MIB::ucdavis.83.100.1 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.83.101.1 = STRING: "/test/haproxy.sh: Permission denied"
UCD-SNMP-MIB::ucdavis.83.102.1 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.83.103.1 = ""
Does the haproxy.sh script reside in the location '/test/' ? Did you change the permissions of the script to executable ?

Code: Select all

chmod 750 /test/haproxy.sh
--
Regardz,
BWare
fantasygoat
Posts: 21
Joined: Wed May 16, 2007 5:17 pm

Re: HaProxy statistics

Post by fantasygoat »

I'm trying to get the perl version of this to work on my machine, but I'm only using v1 SNMP and the tests all seem to be for v2 or v3.

Is there some way for me to test the perl script or run the queries on the command line?
rhian
Posts: 1
Joined: Tue Jan 31, 2012 5:12 am

Re: HaProxy statistics

Post by rhian »

is there any update for this haproxy template?
Can we have the preview of its?

Code: Select all

[root@haproxy run]# snmpbulkwalk -c public -v2c localhost .1.3.6.1.4.1.2021.83
UCD-SNMP-MIB::ucdavis.83 = No Such Instance currently exists at this OID

Code: Select all

[root@haproxy run]# snmpd -v

NET-SNMP version:  5.5
Web:               http://www.net-snmp.org/
Email:             net-snmp-coders@lists.sourceforge.net

[root@haproxy run]# snmpd -H  2>&1 | grep -i pass
    smuxpeer                 OID-IDENTITY PASSWORD
    createUser               username [-e ENGINEID] (MD5|SHA) authpassphrase [DES [privpassphrase]]
    pass                     miboid command
    pass_persist             miboid program
    defPassphrase            string
    defAuthPassphrase        string
    defPrivPassphrase        string
eode
Posts: 3
Joined: Thu Mar 22, 2012 6:13 am

Re: HaProxy statistics

Post by eode »

rhian wrote:is there any update for this haproxy template?
Can we have the preview of its?

Code: Select all

[root@haproxy run]# snmpbulkwalk -c public -v2c localhost .1.3.6.1.4.1.2021.83
UCD-SNMP-MIB::ucdavis.83 = No Such Instance currently exists at this OID
The script may not be executing correctly -- that's what it was for me.

* Check permissions -- ensure haproxy.sh is executable
* Check to ensure you've installed socat
eode
Posts: 3
Joined: Thu Mar 22, 2012 6:13 am

Re: HaProxy statistics

Post by eode »

I was getting the following error, and couldn't determine the cause. It's possible there's a typo, and index_order consequently references a nonexistent field, but I couldn't find it.

Code: Select all

Invalid field <index_order>pxname:svname:qcur:qmax:scur:smax:slim:stot:bin:bout:dreq:dresp:ereq:econ:eresp:wretr:wredis:status:weight:act:bck:chkfail:chkdown:lastchg:downtime:qlimit:pid:iid:sid:throttle:lbtot:tracked:type:rate:rate_lim:rate_max:idx</index_order>
Must contain <direction>input</direction> fields only
Since this just determines field ordering, and wasn't absolutely necessary, I removed the <index_order>....</index_order> tag (and it's contents), and it now this works for me. :-) I just thought I'd share since it was a bit of a pain sorting it out.
c23
Posts: 1
Joined: Thu Dec 06, 2012 10:10 am

Re: HaProxy statistics

Post by c23 »

I hit exactly the same issue.

If you look at man page of snmpd.conf :

extend [MIBOID] NAME PROG ARGS
works in a similar manner to the exec directive, but with a number of improvements. The MIB
tables (nsExtendConfigTable etc) are indexed by the NAME token, so are unaffected by the order
in which entries are read from the configuration files.



I suppose you rooted (just like I did) your custom OID under an existing MIBOID (the default ones used by the system), so your "exec" entry was ignored. I suppose the order is to read the main MIBs, then process the custom "exec" directives (means, your "exec" directive was read "at the end")

Using "extend" will force the custom OID you used to be mounted under an existing MIDOIB, no matter the "order" OIDs were defined.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest