LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > Install/Configuration > No output from SNMP

Reply
 
Thread Tools Display Modes
  #1  
Old 03-01-2010, 12:41 PM
garnser garnser is offline
Member
 
Join Date: Feb 2010
Posts: 17
Default No output from SNMP

Hi all,

I recently tried getting SNMP working with my Litespeed server but for some reason no data is presented when quering it with SNMP.

I followed this guide:
http://www.litespeedtech.com/support...cti_monitoring

Code:
# apt-get install php5-cli php5-common php5-snmp
Added the following to /etc/snmp/snmpd.conf (There's preexisting configuration for other MIBs which works)
Code:
pass .1.3.6.1.4.1.22253 /usr/bin/php /usr/local/lsws/add-ons/snmp_monitoring/sample.php
Running it locally returns:
Code:
# php -q ./sample.php -n .1.3.6.1.4.1.22253.101
.1.3.6.1.4.1.22253.101.1
string
LiteSpeed Web Server
The SNMP log only shows that a SNMP query has been requested but not output was provided.

Please advice.
Reply With Quote
  #2  
Old 03-01-2010, 12:45 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
Maybe it is because snmp agent call an external application to serve the request.
You got the result from sample.php, right? it is working.
Reply With Quote
  #3  
Old 03-01-2010, 12:52 PM
garnser garnser is offline
Member
 
Join Date: Feb 2010
Posts: 17
Quote:
Originally Posted by mistwang View Post
Maybe it is because snmp agent call an external application to serve the request.
You got the result from sample.php, right? it is working.
Wouldn't the log return some kinds of errors if that was the case?
Reply With Quote
  #4  
Old 03-01-2010, 01:18 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
I think it is just the way it works.
You should ask net-snmp developers about this, it is not something develop by LiteSpeed.
Reply With Quote
  #5  
Old 03-01-2010, 02:33 PM
garnser garnser is offline
Member
 
Join Date: Feb 2010
Posts: 17
Quering the script with extend rather than pass gave this output:
SNMPv2-SMI::enterprises.22253.1.0 = INTEGER: 1
SNMPv2-SMI::enterprises.22253.2.1.2.12.47.117.115.114.47. 98.105.110.47.112.104.112 = STRING: "/usr/local/lsws/add-ons/snmp_monitoring/sample.php"
SNMPv2-SMI::enterprises.22253.2.1.3.12.47.117.115.114.47. 98.105.110.47.112.104.112 = ""
SNMPv2-SMI::enterprises.22253.2.1.4.12.47.117.115.114.47. 98.105.110.47.112.104.112 = ""
SNMPv2-SMI::enterprises.22253.2.1.5.12.47.117.115.114.47. 98.105.110.47.112.104.112 = INTEGER: 5
SNMPv2-SMI::enterprises.22253.2.1.6.12.47.117.115.114.47. 98.105.110.47.112.104.112 = INTEGER: 1
SNMPv2-SMI::enterprises.22253.2.1.7.12.47.117.115.114.47. 98.105.110.47.112.104.112 = INTEGER: 1
SNMPv2-SMI::enterprises.22253.2.1.20.12.47.117.115.114.47 .98.105.110.47.112.104.112 = INTEGER: 4
SNMPv2-SMI::enterprises.22253.2.1.21.12.47.117.115.114.47 .98.105.110.47.112.104.112 = INTEGER: 1
SNMPv2-SMI::enterprises.22253.3.1.1.12.47.117.115.114.47. 98.105.110.47.112.104.112 = STRING: "/usr/local/lsws/add-ons/snmp_monitoring/sample.php: Permission denied"
SNMPv2-SMI::enterprises.22253.3.1.2.12.47.117.115.114.47. 98.105.110.47.112.104.112 = STRING: "/usr/local/lsws/add-ons/snmp_monitoring/sample.php: Permission denied"
SNMPv2-SMI::enterprises.22253.3.1.3.12.47.117.115.114.47. 98.105.110.47.112.104.112 = INTEGER: 1
SNMPv2-SMI::enterprises.22253.3.1.4.12.47.117.115.114.47. 98.105.110.47.112.104.112 = INTEGER: 1
SNMPv2-SMI::enterprises.22253.4.1.2.12.47.117.115.114.47. 98.105.110.47.112.104.112.1 = STRING: "/usr/local/lsws/add-ons/snmp_monitoring/sample.php: Permission denied"

Gives you a bit more to work on.
Reply With Quote
  #6  
Old 03-01-2010, 02:37 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
chmod a+x /usr/local/lsws/add-ons/snmp_monitoring/sample.php

add
#!/usr/local/bin/php

at the beginning of sample.php if it is not there.
Reply With Quote
  #7  
Old 03-01-2010, 02:41 PM
garnser garnser is offline
Member
 
Join Date: Feb 2010
Posts: 17
Ok getting a bit closer however I'm still not getting the full output:

root@mon:~# snmpwalk -c public -v 1 10.254.11.101 .1.3.6.1.4.1.22253
SNMPv2-SMI::enterprises.22253.1.0 = INTEGER: 1
SNMPv2-SMI::enterprises.22253.2.1.2.12.47.117.115.114.47. 98.105.110.47.112.104.112 = STRING: "/var/lib/snmp/snmp_monitoring/sample.php"
SNMPv2-SMI::enterprises.22253.2.1.3.12.47.117.115.114.47. 98.105.110.47.112.104.112 = ""
SNMPv2-SMI::enterprises.22253.2.1.4.12.47.117.115.114.47. 98.105.110.47.112.104.112 = ""
SNMPv2-SMI::enterprises.22253.2.1.5.12.47.117.115.114.47. 98.105.110.47.112.104.112 = INTEGER: 5
SNMPv2-SMI::enterprises.22253.2.1.6.12.47.117.115.114.47. 98.105.110.47.112.104.112 = INTEGER: 1
SNMPv2-SMI::enterprises.22253.2.1.7.12.47.117.115.114.47. 98.105.110.47.112.104.112 = INTEGER: 1
SNMPv2-SMI::enterprises.22253.2.1.20.12.47.117.115.114.47 .98.105.110.47.112.104.112 = INTEGER: 4
SNMPv2-SMI::enterprises.22253.2.1.21.12.47.117.115.114.47 .98.105.110.47.112.104.112 = INTEGER: 1
SNMPv2-SMI::enterprises.22253.3.1.1.12.47.117.115.114.47. 98.105.110.47.112.104.112 = ""
SNMPv2-SMI::enterprises.22253.3.1.2.12.47.117.115.114.47. 98.105.110.47.112.104.112 = ""
SNMPv2-SMI::enterprises.22253.3.1.3.12.47.117.115.114.47. 98.105.110.47.112.104.112 = INTEGER: 1
SNMPv2-SMI::enterprises.22253.3.1.4.12.47.117.115.114.47. 98.105.110.47.112.104.112 = INTEGER: 0
SNMPv2-SMI::enterprises.22253.4.1.2.12.47.117.115.114.47. 98.105.110.47.112.104.112.1 = ""
Reply With Quote
  #8  
Old 03-01-2010, 02:54 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
Maybe you need to use

#!/usr/local/bin/php -q

to silence PHP header output.
Reply With Quote
  #9  
Old 03-01-2010, 03:01 PM
garnser garnser is offline
Member
 
Join Date: Feb 2010
Posts: 17
Hm, did seam to help, however as the file is executeble I configured snmpd to query the script directly instead extend .1.3.6.1.4.1.22253 /var/lib/snmp/snmp_monitoring/sample.php

Which gives me this:
root@mon:~# snmpwalk -c public -v 1 10.254.11.101 .1.3.6.1.4.1.22253
SNMPv2-SMI::enterprises.22253.1.0 = INTEGER: 1
SNMPv2-SMI::enterprises.22253.2.1.2.40.47.118.97.114.47.1 08.105.98.47.115.110.109.112.47.115.110.109.112.95 .109.111.110.105.116.111.114.105.110.103.47.115.97 .109.112.108.101.46.112.104.112 = STRING: "
"
SNMPv2-SMI::enterprises.22253.2.1.3.40.47.118.97.114.47.1 08.105.98.47.115.110.109.112.47.115.110.109.112.95 .109.111.110.105.116.111.114.105.110.103.47.115.97 .109.112.108.101.46.112.104.112 = ""
SNMPv2-SMI::enterprises.22253.2.1.4.40.47.118.97.114.47.1 08.105.98.47.115.110.109.112.47.115.110.109.112.95 .109.111.110.105.116.111.114.105.110.103.47.115.97 .109.112.108.101.46.112.104.112 = ""
SNMPv2-SMI::enterprises.22253.2.1.5.40.47.118.97.114.47.1 08.105.98.47.115.110.109.112.47.115.110.109.112.95 .109.111.110.105.116.111.114.105.110.103.47.115.97 .109.112.108.101.46.112.104.112 = INTEGER: 5
SNMPv2-SMI::enterprises.22253.2.1.6.40.47.118.97.114.47.1 08.105.98.47.115.110.109.112.47.115.110.109.112.95 .109.111.110.105.116.111.114.105.110.103.47.115.97 .109.112.108.101.46.112.104.112 = INTEGER: 1
SNMPv2-SMI::enterprises.22253.2.1.7.40.47.118.97.114.47.1 08.105.98.47.115.110.109.112.47.115.110.109.112.95 .109.111.110.105.116.111.114.105.110.103.47.115.97 .109.112.108.101.46.112.104.112 = INTEGER: 1
SNMPv2-SMI::enterprises.22253.2.1.20.40.47.118.97.114.47. 108.105.98.47.115.110.109.112.47.115.110.109.112.9 5.109.111.110.105.116.111.114.105.110.103.47.115.9 7.109.112.108.101.46.112.104.112 = INTEGER: 4
SNMPv2-SMI::enterprises.22253.2.1.21.40.47.118.97.114.47. 108.105.98.47.115.110.109.112.47.115.110.109.112.9 5.109.111.110.105.116.111.114.105.110.103.47.115.9 7.109.112.108.101.46.112.104.112 = INTEGER: 1
SNMPv2-SMI::enterprises.22253.3.1.1.40.47.118.97.114.47.1 08.105.98.47.115.110.109.112.47.115.110.109.112.95 .109.111.110.105.116.111.114.105.110.103.47.115.97 .109.112.108.101.46.112.104.112 = STRING: "No such file or directory"
SNMPv2-SMI::enterprises.22253.3.1.2.40.47.118.97.114.47.1 08.105.98.47.115.110.109.112.47.115.110.109.112.95 .109.111.110.105.116.111.114.105.110.103.47.115.97 .109.112.108.101.46.112.104.112 = STRING: "No such file or directory"
SNMPv2-SMI::enterprises.22253.3.1.3.40.47.118.97.114.47.1 08.105.98.47.115.110.109.112.47.115.110.109.112.95 .109.111.110.105.116.111.114.105.110.103.47.115.97 .109.112.108.101.46.112.104.112 = INTEGER: 1
SNMPv2-SMI::enterprises.22253.3.1.4.40.47.118.97.114.47.1 08.105.98.47.115.110.109.112.47.115.110.109.112.95 .109.111.110.105.116.111.114.105.110.103.47.115.97 .109.112.108.101.46.112.104.112 = INTEGER: 1
SNMPv2-SMI::enterprises.22253.4.1.2.40.47.118.97.114.47.1 08.105.98.47.115.110.109.112.47.115.110.109.112.95 .109.111.110.105.116.111.114.105.110.103.47.115.97 .109.112.108.101.46.112.104.112.1 = STRING: "No such file or directory"

Any idea what file that could be missing?
Reply With Quote
  #10  
Old 03-02-2010, 11:29 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
Maybe you should use
Quote:
pass .1.3.6.1.4.1.22253 /usr/bin/php -q /litespeed_snmp_scripts/sample.php
remove "#!/usr/bin/php -q" from sample.php
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 02:07 AM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.