Here is a new version of this plugin with new name (cAMM 1.5.0) http://forums.cacti.net/viewtopic.php?p=156769#156769
Hi All!
Here is my first plugin for Cacti.
Besides it is my first work on php
----[ Requirements:
- - Cacti 0.8.7b/c
- Plugin Architecture v2.х for Cacti v0.8.7b/c
- NET-SNMP trapd
- SNMPTT from http://www.snmptt.org/
----[ Installation
computer_guru wrote:FYI, I have also created a CactiEZ / SNMPTT tutorial:
http://paulscomputerservice.net/article ... .php?ID=50
- IMPORTANT: This plugin ONLY show data from mysql. It does not accept snmp traps.
By analogy with syslog plugin:
syslog-ng => mysql => syslog plugin
snmptrapd => SNMPTT=> mysql => snmptt plugin
- 1. Install just like any other plugin, just throw it in the plugin directory, in a folder called snmptt.
Edit your includes/config.php and add it to your $plugins list, and you are rolling.
For PIA 2.0 and higher go to :
1.1 Console->Plugin Management->Uninstalled tab->snmptt -> install
1.2 Console->Plugin Management->Installed tab->snmptt -> enable
2. After that, change same setting in snmptt.ini:
Code: Select all
mibs_environment = ALL
date_time_format = %Y-%m-%d %H:%M:%S
unknown_trap_log_enable = 1
statistics_interval = 300
db_translate_enterprise = 1
mysql_dbi_enable = 1
mysql_dbi_table = plugin_snmptt
mysql_dbi_table_unknown = plugin_snmptt_unknown
mysql_dbi_table_statistics = plugin_snmptt_statistics
mysql_dbi_host = localhost # << CHANGE !
mysql_dbi_port = 3306 # << CHANGE !
mysql_dbi_database = cacti # << CHANGE !
mysql_dbi_username = cactiuser # << CHANGE !
mysql_dbi_password = cactipassword # << CHANGE !
mysql_ping_on_insert = 1
mysql_ping_interval = 300
date_time_format_sql = %Y-%m-%d %H:%M:%S
stat_time_format_sql = %Y-%m-%d %H:%M:%S
........
--- 1.2.2rc ---
- - Rebuild "Add/Edit rule" window again. New system for creating filter - more powerfull.
This update DELETE ALL existinf rule, you need recreate it after;
- New rule's modes - "Mark rule" and "Execute user functions". User functions must be in snmptt/lib/
- "Show full unknown traps info" window;
- Deleted "Create rule based on traps";
- Fix bug for show stats if [plugin_snmptt_statistics] table is emty;
Minor updates:
- Constrain the window to the viewport;
- Just after create and save rule - auto reload grid, so deleting new rule work fine;
- Changed type formatline for unknown traps table from varchar(255) to text;
- ReFixed save/restore state (IE). Checked on IE, GC, FF.
- - Added Syslog tab. It may be use both/seperetly with cacti SYSLOG plugin. ([HOWTO] Install Syslog 0.5.2 plugin on Linux/Unix Cacti vers - http://forums.cacti.net/viewtopic.php?t=26040)
--For use syslog tab WITHOUT old cacti SYSLOG plugin:
Change the following lines to the /etc/syslog-ng/syslog-ng.conf file to the END of the file:
--For use syslog tab AND old cacti SYSLOG plugin:Code: Select all
source net { udp(); }; destination d_mysql { pipe("/tmp/mysql.pipe" template("INSERT INTO plugin_snmptt_syslog (host, sourceip, facility, priority, sys_date, message, status) VALUES ( '$HOST', '$SOURCEIP', '$FACILITY', '$PRIORITY', '$YEAR-$MONTH-$DAY $HOUR:$MIN:$SEC', '$MSG', '0' );\n") template-escape(yes) ); }; log { source(net); destination(d_mysql); }; log { source(s_sys); destination(d_mysql); };
Change the following lines to the /etc/syslog-ng/syslog-ng.conf file to the END of the file:
Code: Select all
source net { udp(); }; destination d_mysql { pipe("/tmp/mysql.pipe" template("INSERT INTO syslog_incoming (host, sourceip, fullhost, facility, priority, date, time, message) VALUES ( '$HOST', '$SOURCEIP', '$FULLHOST','$FACILITY', '$PRIORITY', '$YEAR-$MONTH-$DAY', '$HOUR:$MIN:$SEC', '$MSG' ); INSERT INTO plugin_snmptt_syslog (host, sourceip, facility, priority, sys_date, message, status) VALUES ( '$HOST', '$SOURCEIP', '$FACILITY', '$PRIORITY', '$YEAR-$MONTH-$DAY $HOUR:$MIN:$SEC', '$MSG', '0' );\n") template-escape(yes) ); }; log { source(net); destination(d_mysql); }; log { source(s_sys); destination(d_mysql); };
- Optimize sql for create tree menu (for 1000000 traps create tree menu take 3-5 sec);
- Added Setting tab;
- Switch to use ExtJS v 2.2;
- In rules added "Force run" function - run this rule for already processed records (traps or syslog);
- Update for graph and cacti/scripts/ss_snmpttpoller.php in addons.rar/graph
Fix:
- Fixed error when deleting unk. traps records;
- Fix error in poller auto purge deleting;
- Fix error with incorrect [plugin_snmptt_alert] table when first install plugin;
Minor updates:
- Allow Email Message field in rule be blank;
- Added patch to autosize column header width on Dbl click;
- For Syslog treeMenu added full expand/collapse all menu items and quick filter.
- - Add Syslog tab unused by default. For use it - change [Use SYSLOG] parameter in settings tab AND reload plugin page.
- - Hide Syslog tab if it is unused (by default);
- Fix sql error is syslog unused;
Need update addons.rar/graph/ss_snmpttpoller to cacti/scripts/ss_snmpttpoller.php.
- One more fix errors if syslog unused;
- Convert filter comboboxes to combo and textbox;
- - Syslog database name now may be any and changed in settings. Default is [syslog_ng]. If You have another - than after install/update plugin - change setting and import plugin_snmptt_syslog.sql in You syslog db.
- Now you can use one of two viewing mode's - "show all records" or "show only records, already processed by poller (i.e. by rules)". Change mode in settings tab.
- Create rule based on traps;
- Create rule based on syslog message;
Minor updates:
- Correct sorting in settings;
- Speed up of the process rule's executing by process all deletion rules first, and to process the rules that see the highest amount of hits first. (thanks cigamit);
- - Added new parameter for choose join method (dns hostname or ip-address). Use that method which you use in hostname field of cacti device's.
- Fix 2 error in poller.
- Fix error with creating rule from record.
- Added setting to use regular or smaller tab.
Minor updates:
- Settings tab look more like Cacti default;
- ReCheck user rigth;
- Minor updates:
- Use ExtJS v2.2.1;
- Add indices for syslog table (may cause long time to first open page);
- Use mysql_affected_rows() instead of ROW_COUNT();
- Fix error in snmptt_header_ext.php (thanks savagemindz);
This is a last version of snmptt plugin.
Next will be camm (CActi Message Manager) plugin 1.5