SNMPTT/SYSLOG viewer Plugin for Cacti. v 1.4.3 (2009/02/06)

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
User avatar
gthe
Cacti User
Posts: 410
Joined: Sat Jul 29, 2006 1:23 pm
Location: RU

Post by gthe »

gumis wrote: I've tried Chrome as well, still no luck - empty pane on the right.
Thats strange. At the end - try FF. And what about panel in Chrome ?
gumis wrote:Although I've noticed that 'formatline' field in plugin_snmptt_unknown table has only 255 chars, so that might be the problem (limitation - sounds better).The same field in plugin_snmptt table is Text.
Added in next version.
gumis wrote: I'm not quite sure what exactly do you mean with that `alert` field. I'll have a quick look as soon as I can on the *.php files to see if I could help with that. Can you let me know which files would have to be modified?
I can create mode to change trap's alert field. (when you open full trap view window - you can see alert field).
So, you can create rule to change this field. But I cannot create graphs, based on this field value, because I don't know which value you will use, and what it mean.

Thanks and sorry for my English.
123ralle
Posts: 15
Joined: Wed Dec 20, 2006 7:32 am

Post by 123ralle »

Hi gthe,

i've another suggestion for the rules :

It would be nice, to have an rule action for executing an external program.

With that rule somebody could trigger an event for an NMS, like sending
an event via nsca to an nagios host.

In the settings it should be possible to define the trigged programm and define some arguments for the program.

The deluxe variant for this, would be placeholders for the arguments,
like hostname, event, etc to distingish the events on the NMS.

regards,
Ralf
gumis
Posts: 10
Joined: Sun Nov 09, 2008 9:39 am

Post by gumis »

Thats strange. At the end - try FF. And what about panel in Chrome ?
No luck with FF as well. Blank page, I can't see anything at all even after pressing the Update button. Would you know what could cause the problem? What else could I try ?
I can create mode to change trap's alert field. (when you open full trap view window - you can see alert field).
So, you can create rule to change this field. But I cannot create graphs, based on this field value, because I don't know which value you will use, and what it mean.
I know what you mean now. But, to make it more universal for other users, what would you say about this:
when you go to Rules tab and then click on Add new rule, you can create new rule with mode 'Monitor'. Instead of e-mail and message field you could put simple drop-down box with for example... 10 values like 'monitor1', 'monitor2'...'monitor10'. By doing this you would assign new created rule to 'monitorX' variable.
Of course values in drop-down boxes would have to be marked somehow (which one are in use already), perhaps even renamed to rule's name? This would limit monitoring to 10 concurrent sessions at the same time, but would be more universal.

So lets say that I have a firewall on the network sending snmp traps to my box about people on my blacklist trying to login to any of the services on my internal network. My linux (snmptrapd) box caches that and executes snmptt.
Now in Cacti: I would go to 'Add new rule' and:
- rule name: 'Blacklisted_Idiots'
- mode: 'Monitor'
- assign to: '1. monitor1' (new created drop-down box)
- format line search: 'Contains'
- format line: 'B-listed' (let say that my firewall marks them like that)
- hostname: my_firewall

after you click on the save button, it could re-name '1. monitor1' field to '1. Blacklisted_Idiots'.
Then you could put them all on the graph as well - maybe additional one.

How about that?
User avatar
gthe
Cacti User
Posts: 410
Joined: Sat Jul 29, 2006 1:23 pm
Location: RU

Post by gthe »

123ralle - execute external program is not so simple (especially with parametres). I offer other variant - execute user php function like this:

Code: Select all

function snmptt_user_test1 ($alerted_trap, $alert) {

	cacti_log("Got trap with id=" . $alerted_trap["id"], false, "SNMPTT");

};
So, you can create own function, place it in snmptt_user_func.php and execute any external program in that function.
I try add this in next ver.
gumis wrote: No luck with FF as well. Blank page, I can't see anything at all even after pressing the Update button. Would you know what could cause the problem? What else could I try ?
Thats fixed.

gumis - about mark trap rule - will try to implement this.


sorry for my english.
User avatar
gthe
Cacti User
Posts: 410
Joined: Sat Jul 29, 2006 1:23 pm
Location: RU

Post by gthe »

New version in first post.
--- 1.2.2rc ---
  • - Rebuild "Add/Edit rule" window again. New system for creating filter - more powerfull.
    This update DELETE ALL existing 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.
gumis
Posts: 10
Joined: Sun Nov 09, 2008 9:39 am

Post by gumis »

gthe first of all thanks for the update.
after update I'm having problems with saving rules...
When i press 'Done' button it goes to Rules window where I need to press 'Save' to save it... But as soon as I do that, it vanishes from the list. At the moment I can't add any rules, they all go...

Regards
User avatar
gthe
Cacti User
Posts: 410
Joined: Sat Jul 29, 2006 1:23 pm
Location: RU

Post by gthe »

gumis, try recreate alert table:

Code: Select all

DROP TABLE IF EXISTS `plugin_snmptt_alert`;
CREATE TABLE  `plugin_snmptt_alert` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `name` varchar(255) NOT NULL,
  `is_function` tinyint(1) NOT NULL default '0',
  `is_email` tinyint(1) NOT NULL default '0',
  `is_mark` tinyint(1) NOT NULL default '0',
  `is_delete` tinyint(1) NOT NULL default '0',
  `function_name` varchar(255) default NULL,
  `email` varchar(255) default NULL,
  `email_message` text,
  `marker` tinyint(2) NOT NULL default '0',
  `notes` varchar(255) default NULL,
  `json_filter` text,
  `sql_filter` text,
  `user_id` int(10) unsigned NOT NULL default '0',
  `date` datetime default NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `unique` USING BTREE (`is_function`,`is_email`,`is_mark`,`is_delete`,`function_name`(25),`email`(25),`marker`)
) ENGINE=MyISAM AUTO_INCREMENT=100 COMMENT='Traps Alert';
My cacti plugin -[url=http://forums.cacti.net/viewtopic.php?p=156769#156769]CaMM[/url]
[size=75]Sorry for my English. [/size]
gumis
Posts: 10
Joined: Sun Nov 09, 2008 9:39 am

Post by gumis »

yep! Thanks a lot gthe.

I'm going to test all new options now.
westside
Posts: 4
Joined: Fri Nov 07, 2008 2:38 pm

Error with new Update

Post by westside »

I am getting the following error when I try to create a new rule and I am doing the "Edit filter for rule" When I click done I get the below error.

Fatal error: Call to undefined function json_encode()
in /var/www/html/plugins/snmptt/snmptt_db.php on line 865
User avatar
gthe
Cacti User
Posts: 410
Joined: Sat Jul 29, 2006 1:23 pm
Location: RU

Post by gthe »

westside - you hostinfo (php, apache, mysql versions) ?

Or try this version snmpt_db.php (just replace it).
My cacti plugin -[url=http://forums.cacti.net/viewtopic.php?p=156769#156769]CaMM[/url]
[size=75]Sorry for my English. [/size]
westside
Posts: 4
Joined: Fri Nov 07, 2008 2:38 pm

That fixed the issue

Post by westside »

Thank you for your fast response to this issue. The issue is now resolved. I am glad that you respond and work on issues, as most people on internet are lame. Just kidding.
westside
Posts: 4
Joined: Fri Nov 07, 2008 2:38 pm

Issue with new version of SNMPTT

Post by westside »

I made a rule to email me a TRAP and when I hit the test button on the rule it does not show any results. I tested rules that I built earlier and they work. Also I have no way of making a rule from the Trap List as the icon that use to be there is no longer there any more. I am running CactiEZ.
computer_guru
Cacti User
Posts: 141
Joined: Thu Apr 10, 2008 6:52 pm

No tree

Post by computer_guru »

I found my Tree view missing today. What are the first steps in troubleshooting this?


I tried the refresh and recreate buttons with no success.

SNMPTT plugin: 1.0.23b
Cacti 0.8.7b
User avatar
gthe
Cacti User
Posts: 410
Joined: Sat Jul 29, 2006 1:23 pm
Location: RU

Post by gthe »

If You can - provide me next sql rezults:

Code: Select all

SELECT * FROM settings where name like '%snmpt%'

Code: Select all

SELECT count(*) FROM plugin_snmptt;

Code: Select all

SELECT count(*) FROM plugin_snmptt_tree;
My cacti plugin -[url=http://forums.cacti.net/viewtopic.php?p=156769#156769]CaMM[/url]
[size=75]Sorry for my English. [/size]
computer_guru
Cacti User
Posts: 141
Joined: Thu Apr 10, 2008 6:52 pm

here are the results

Post by computer_guru »

see attached files for results. The tree pane in the SNMPTT plugin, is just completely empty. No error messages of any kind.

the attached files are in html format. just rename the extension.
Attachments
1st_sql_statement.txt
(1.33 KiB) Downloaded 149 times
2nd_sql_Statement.txt
(391 Bytes) Downloaded 134 times
3rd_sql_statement.txt
(399 Bytes) Downloaded 128 times
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests