ZABBIX Forums  
  #1  
Old 24-12-2009, 06:23
giapnguyen giapnguyen is offline
Member
 
Join Date: Aug 2009
Posts: 31
Default SNMP Builder for Zabbix

I'm working on a snmp builder tool to browse, convert and insert snmp oid into a template. It still some minor bugs. I will post it soon. Here some of screenshots and features.

Name:  snmp_builder.jpg
Views: 53444
Size:  118.8 KB


Support snmp table

Name:  snmp_table.jpg
Views: 52845
Size:  116.9 KB

Last edited by giapnguyen; 24-12-2009 at 06:30.
Reply With Quote
  #2  
Old 24-12-2009, 22:08
sersad sersad is offline
Senior Member
 
Join Date: May 2009
Location: Russia
Posts: 500
Default

qool
when I can try?
Reply With Quote
  #3  
Old 25-12-2009, 15:46
giapnguyen giapnguyen is offline
Member
 
Join Date: Aug 2009
Posts: 31
Default

Here you are
Moderator Edit, Link broken, location preserved, spaces added to prevent clickable link:
http:// yahgho. bytehost22. com/wiki/doku.php?id=blog:snmp_builder


Features:
  • MIB Browser: you can select default MIB files or your own device MIBs to get OID tree. Click on the tree to retrieve value and information about a OID. Click to select the OID as Zabbix's item.
  • OID Table support: it assume that a OID whose name's end with string 'Table' is a OID Table. OID Table will retrieve with all it's indexes. Click on the cell to select the index as Zabbix's item. If my above assumption is wrong, you can use the checkbox “view as table” to switch between table and normal view.
  • Column selection: On OID Table, click on a header will select a whole column as Zabbix's items. It's useful if you create SNMP template for a 48 ports switch.
  • Auto convert: I implement a simple convert from SNMP Type to Zabbix's item.

If u got any bugs, please post here.

Last edited by nelsonab; 10-09-2013 at 21:52. Reason: Link broken
Reply With Quote
  #4  
Old 25-12-2009, 18:43
Firm Firm is offline
Senior Member
 
Join Date: Dec 2009
Posts: 339
Default

giapnguyen,

Great work! It's one of most awaiting features I've wished to see. But I have small problem: can't browse MIB tree. After selecting MIB from drop-down list I have the following in the left sub-window.
Attached Images
 
Reply With Quote
  #5  
Old 25-12-2009, 19:19
giapnguyen giapnguyen is offline
Member
 
Join Date: Aug 2009
Posts: 31
Default

Hi Firm
Yeah, my code heavily rely on snmp OS commands. I work on Ubuntu 9.10 and still not sure the output is same in other *nix. So please tell what OS, you install zabbix and try to run from OS prompt

snmptranslate -Ts -M <your MIBS_ALL_PATH> -m SNMPv2-MIB

Give me the output, and I will know why it don't render the oid tree
Reply With Quote
  #6  
Old 26-12-2009, 05:38
ericgearhart ericgearhart is offline
Senior Member
 
Join Date: Jan 2009
Posts: 114
Default Awesome!

I just want to add that from your screenshots this looks awesome... easy SNMP integration was the one thing I was really missing from Cacti.

I will give it a shot on my install of Zabbix (version 1.8, on CentOS 5.4) and post back if I have problems
Reply With Quote
  #7  
Old 29-12-2009, 12:16
Firm Firm is offline
Senior Member
 
Join Date: Dec 2009
Posts: 339
Default

giapnguyen,

CentOS 5.3 x86. The output is attached.
Attached Files
File Type: txt snmpwalk.txt (5.1 KB, 2643 views)

Last edited by Firm; 29-12-2009 at 12:18.
Reply With Quote
  #8  
Old 29-12-2009, 15:09
mrspy mrspy is offline
Junior Member
 
Join Date: Oct 2009
Posts: 8
Default

I'm having the following problems:

Code:
* Undefined index: templateid[/home/zabbix/public_html_svn/snmp_builder.php:125]
* Undefined index: oids[/home/zabbix/public_html_svn/snmp_builder.php:126]
* Undefined index: viewtype[/home/zabbix/public_html_svn/snmp_builder.php:127]
If I change the template, nothing happens...
If I change the MIB I have the following errors:

Code:
    * Undefined index: oids[/home/zabbix/public_html_svn/snmp_builder.php:126]
    * Undefined index: viewtype[/home/zabbix/public_html_svn/snmp_builder.php:127]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
    * Undefined index: items[/home/zabbix/public_html_svn/snmp_builder.php:576]
Zabbix Server v1.8 (revision 8565)
Zabbix Frontend SVN revision 8917
Ubuntu 8.04.3 LTS

Tested with Firefox and Chrome
Reply With Quote
  #9  
Old 29-12-2009, 15:12
mrspy mrspy is offline
Junior Member
 
Join Date: Oct 2009
Posts: 8
Default

Hummm, in Zabbix 1.8 (revision 8565) frontend this problem does not occur...
Reply With Quote
  #10  
Old 30-12-2009, 11:11
giapnguyen giapnguyen is offline
Member
 
Join Date: Aug 2009
Posts: 31
Default

Quote:
Originally Posted by Firm View Post
giapnguyen,

CentOS 5.3 x86. The output is attached.
Your output is fine. It's same with mine. I narrow down your problem to (1) snmptranslate not in search directory of apache's user, so it can't lauch the command; (2) there is a permission problem prevent snmptranslate run from php script (maybe because of selinux, apparmor, php.ini ...)

I glad to use php's snmp api to avoid OS-dependent problems but unfortunately it don't have sufficient features. I will install a CentOS 5.3 to check it.

You can try create a test.php in zabbix web dir contains:
PHP Code:
<?php
    exec
("snmptranslate -Ts -M /usr/share/snmp/mibs -m SNMPv2-MIB 2>&1"$results);
    
print_r($results);
?>
Browse the test.php to see what happen when run snmptranslate from web.
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 +2. The time now is 10:07.