mySNMP - SNMP-Tools for Cacti

Announcements concerning Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
kyosanim
Posts: 37
Joined: Thu Apr 05, 2007 5:33 am

mySNMP - SNMP-Tools for Cacti

Post by kyosanim »

My first selfmade plugin!

Its a little but useful tool. i'am using it at work to get information from hundreds of routers.
maybe it is useful for you too.

----[ Requirements

Perl, Perl:DBI, Net-SNMP, Cacti >= 0.8.7

----[ Features

- Simple SNMP-GET and SNMP-WALK-Querys per Webinterface
- Host-filter for customized requests
- Export function to Exel (xls)
- Adding own ODIs to Database


please give me feedback...
regards
kyosanim
Attachments
mySNMP.rar
(35.49 KiB) Downloaded 533 times
Last edited by kyosanim on Fri Feb 22, 2008 2:47 pm, edited 2 times in total.
kyosanim
Posts: 37
Joined: Thu Apr 05, 2007 5:33 am

Post by kyosanim »

don't be shy -
feedback would be nice ;-)
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

Hi

nice plugin :)

I have an error running it with Cacti 0.8.7b and plugin arch 2.0 :

Code: Select all

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/cactiuser/cacti-0.8.7b/plugins/mySNMP/mySNMP.php on line 269
when going to the "mySNMP" tab, and

Code: Select all

Notice: Undefined index: mySNMP.php:actions in /home/cactiuser/cacti-0.8.7b/lib/functions.php on line 1634
when running a walk.
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

Oops, I forgot to import database.sql :oops:

But it returns an error :

Code: Select all

$ mysql cacti -p < database.sql
Enter password:
ERROR 1062 (23000) at line 46: Duplicate entry '0' for key 1
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
kyosanim
Posts: 37
Joined: Thu Apr 05, 2007 5:33 am

Post by kyosanim »

thanks for your reply...
i think i have a little mistake in the "insert"-part.

i will correct it and post a working one ;-)


---update ---
here is the fixed database-file
Attachments
database.sql.txt
(2.11 KiB) Downloaded 474 times
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

Thanks, the new .sql file imports correctly.
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
airwalk
Cacti User
Posts: 103
Joined: Fri Aug 18, 2006 11:22 am
Location: MSK, RU

Post by airwalk »

I get the follwoing error after clicking "Yes" on the page saying "To start the SNMP-Get, press the "yes" button below."


Notice: Undefined variable: version in C:\cacti\plugins\mySNMP\mySNMP.php on line 166

Warning: Cannot modify header information - headers already sent by (output started at C:\cacti\plugins\mySNMP\mySNMP.php:166) in C:\cacti\plugins\mySNMP\mySNMP.php on line 188

What could be the problem.
Cacti is 0.8.7a
Plugin Arch is 1.4
dave99
Posts: 26
Joined: Fri Mar 17, 2006 11:12 pm

Post by dave99 »

fmangeant wrote:Hi

Code: Select all

Notice: Undefined index: mySNMP.php:actions in /home/cactiuser/cacti-0.8.7b/lib/functions.php on line 1634
when running a walk.
I'm getting this same error.
kyosanim
Posts: 37
Joined: Thu Apr 05, 2007 5:33 am

Post by kyosanim »

on line 166 the script starts the snmp get/walk.
what snmp version does the device use?
at the moment mySNMP only supports v2c and v1.

please check if snmp version is correct and if community is set correctly.

@dave99 - i have not tested on a cacti 0.8.7b yet. i will check this out.
Dyr
Posts: 23
Joined: Mon Sep 10, 2007 5:21 am

Post by Dyr »

kyosanim, would be much better, if you'll take all db-related stuff (like password, login etc) from standart include/config.php. It's not such hard, isn't it?
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests