CaMM plugin v1.6.5 issue when editing new rule

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

galerien
Posts: 33
Joined: Wed Feb 11, 2009 12:16 pm
Location: Geneva

CaMM plugin v1.6.5 issue when editing new rule

Post by galerien »

When I try to edit a new rule in the field "SQL filter" i'm getting "1=1" ...

I have selected "SQL filter" then the field "syslog - message" then I put operator "=" and value "GigabitEthernet1/0/2" :

- When I test it return nothing, and when i click on "done" the rule is showing "message is null" ...

if I select "SQL filter" then the field "syslog - message" then I put operator "contains" and value "GigabitEthernet1/0/2" :
- When I test : it return nothing, and when i click on "done" the rule is showing SQL filter : "1=1" ...


could someone please help me ???
galerien
Posts: 33
Joined: Wed Feb 11, 2009 12:16 pm
Location: Geneva

Post by galerien »

Nobody could help me ?

I would apreciate if someone can at least give some clue on this issue ...
mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Post by mcutting »

galerien wrote:Nobody could help me ?

I would apreciate if someone can at least give some clue on this issue ...
Post in the correct topic - you'll get more attention that way.
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
User avatar
gthe
Cacti User
Posts: 410
Joined: Sat Jul 29, 2006 1:23 pm
Location: RU

Post by gthe »

galerien wrote:Nobody could help me ?

I would apreciate if someone can at least give some clue on this issue ...
I can not recreate the problem on my host...
Did you try to create a rule based on an existing syslog record?
My cacti plugin -[url=http://forums.cacti.net/viewtopic.php?p=156769#156769]CaMM[/url]
[size=75]Sorry for my English. [/size]
galerien
Posts: 33
Joined: Wed Feb 11, 2009 12:16 pm
Location: Geneva

Post by galerien »

I also tried to create a rule from an existing syslog record without success :

In the field => Filter (Sql), I have got :

((((host is null AND facility is null) AND priority is null) AND sys_date=STR_TO_DATE('2010-01-18 13:35:01','%Y-%m-%d %H:%i:%s')) AND message is null)

I'm lost... please help...
Attachments
SQLfilter-contains-2.PNG
SQLfilter-contains-2.PNG (44.98 KiB) Viewed 4607 times
User avatar
gthe
Cacti User
Posts: 410
Joined: Sat Jul 29, 2006 1:23 pm
Location: RU

Post by gthe »

galerien wrote:I also tried to create a rule from an existing syslog record without success :

In the field => Filter (Sql), I have got :

((((host is null AND facility is null) AND priority is null) AND sys_date=STR_TO_DATE('2010-01-18 13:35:01','%Y-%m-%d %H:%i:%s')) AND message is null)

I'm lost... please help...
But now everything is normal? SQL string is correct.
My cacti plugin -[url=http://forums.cacti.net/viewtopic.php?p=156769#156769]CaMM[/url]
[size=75]Sorry for my English. [/size]
galerien
Posts: 33
Joined: Wed Feb 11, 2009 12:16 pm
Location: Geneva

Post by galerien »

but I've still got :
- host is null
- facility is null
- priority is null

I think this my problem.

I don't why ?? can it be a problem with my DB ?
User avatar
gthe
Cacti User
Posts: 410
Joined: Sat Jul 29, 2006 1:23 pm
Location: RU

Post by gthe »

Any error in cacti.log in camm debug mode when you are create and save this rule's sql filter ?
My cacti plugin -[url=http://forums.cacti.net/viewtopic.php?p=156769#156769]CaMM[/url]
[size=75]Sorry for my English. [/size]
galerien
Posts: 33
Joined: Wed Feb 11, 2009 12:16 pm
Location: Geneva

Post by galerien »

No, I have no messages at all which could be related to CAMM in cacti.log... even with debug enbled...

I really don't how getting this working....

I already reinstall CAMM, without any improvement....
User avatar
gthe
Cacti User
Posts: 410
Joined: Sat Jul 29, 2006 1:23 pm
Location: RU

Post by gthe »

Try this version of the file (replace). Enable debug mode in camm setting tab and create new rule.
In cacti.log you will see strings like this:

Code: Select all

01/19/2010 12:10:25 PM - camm: Poller[0]  php [camm_convert_json_to_sql_string] [raw_json_where]=[{\"left\":{\"left\":{\"fieldId\":\"facility\",\"operatorId\":\"STRING_EQUAL\",\"values\":[{\"label\":\"local0\",\"value\":\"local0\"}]},\"logicalOperator\":\"AND\",\"right\":{\"fieldId\":\"priority\",\"operatorId\":\"STRING_EQUAL\",\"values\":[{\"label\":\"info\",\"value\":\"info\"}]}},\"logicalOperator\":\"AND\",\"right\":{\"fieldId\":\"message\",\"operatorId\":\"STRING_STARTS_WITH\",\"values\":[{\"label\":\"INFO: The flooding MAC is detected\",\"value\":\"INFO: The flooding MAC is detected\"}]}}]
01/19/2010 12:10:25 PM - camm: Poller[0]  php [camm_convert_json_to_sql_string] [sql_where]=[((facility='local0' AND priority='info') AND message like 'INFO: The flooding MAC is detected%' )]
Post it here with the screen on rule's filter sql.
Attachments
camm_db_admin.rar
(5.46 KiB) Downloaded 105 times
My cacti plugin -[url=http://forums.cacti.net/viewtopic.php?p=156769#156769]CaMM[/url]
[size=75]Sorry for my English. [/size]
galerien
Posts: 33
Joined: Wed Feb 11, 2009 12:16 pm
Location: Geneva

Post by galerien »

I would like to thank you very much to spend time to try to help me :-)

here are the log, I've got :

01/19/2010 11:43:47 AM - camm: Poller[0] php [camm_convert_json_to_sql_string] [sql_where]=[((((host is null AND facility is null) AND priority is null) AND sys_date=STR_TO_DATE('2010-01-19 05:00:27','%Y-%m-%d %H:%i:%s')) AND message is null)]

01/19/2010 11:43:47 AM - camm: Poller[0] php [camm_convert_json_to_sql_string] [raw_json_where]=[{\"left\":{\"left\":{\"left\":{\"left\":{\"fieldId\":\"host\",\"operatorId\":\"STRING_EQUAL\",\"values\":[{\"label\":\"172.xx.yy.3\",\"value\":\"172.xx.yy.3\"}]},\"logicalOperator\":\"AND\",\"right\":{\"fieldId\":\"facility\",\"operatorId\":\"STRING_EQUAL\",\"values\":[{\"label\":\"local7\",\"value\":\"local7\"}]}},\"logicalOperator\":\"AND\",\"right\":{\"fieldId\":\"priority\",\"operatorId\":\"STRING_EQUAL\",\"values\":[{\"label\":\"err\",\"value\":\"err\"}]}},\"logicalOperator\":\"AND\",\"right\":{\"fieldId\":\"sys_date\",\"operatorId\":\"DATE_EQUAL\",\"values\":[{\"value\":\"2010-01-19 05:00:27\",\"label\":\"2010-01-19 05:00:27\"}]}},\"logicalOperator\":\"AND\",\"right\":{\"fieldId\":\"message\",\"operatorId\":\"STRING_EQUAL\",\"values\":[{\"label\":\"9438: Jan 19 05:00:26: %SNMP-3-AUTHFAIL: Authentication failure for SNMP req from host 172.xx.vv.41\",\"value\":\"9438: Jan 19 05:00:26: %SNMP-3-AUTHFAIL: Authentication failure for SNMP req from host 172.xx.vv.41\"}]}}]

I just modify the IP which are shown...

and I also add the screen shot of the result :
Attachments
SQLfilter-contains-3.PNG
SQLfilter-contains-3.PNG (61.11 KiB) Viewed 4548 times
User avatar
gthe
Cacti User
Posts: 410
Joined: Sat Jul 29, 2006 1:23 pm
Location: RU

Post by gthe »

galerien wrote:I would like to thank you very much to spend time to try to help me :-)
What is you environment ? os, php ?

Now need debug next file. Use it from atach and replace in camm/lib folder and repeat the previous step with save rule.
After post strings from cacti.log
Attachments
json_sql.rar
(1.95 KiB) Downloaded 103 times
My cacti plugin -[url=http://forums.cacti.net/viewtopic.php?p=156769#156769]CaMM[/url]
[size=75]Sorry for my English. [/size]
galerien
Posts: 33
Joined: Wed Feb 11, 2009 12:16 pm
Location: Geneva

Post by galerien »

Here are the infos you asked for :
Cacti Version - 0.8.7e
Plugin Architecture - 2.4
Poller Type - Cactid v
Server Info - Linux 2.6.16.60-0.39.3-smp
Web Server - Apache/2.2.3 (Linux/SUSE)
PHP - 5.2.5
PHP Extensions - libxml, xml, session, pcre, SimpleXML, SPL, standard, Reflection, filter, date, apache2handler, ctype, dom, gd, iconv, json, mysql, mysqli, PDO, pdo_mysql, pdo_sqlite, snmp, sockets, SQLite, timezonedb, tokenizer, xmlreader, xmlrpc, zlib
MySQL - 5.0.26
RRDTool - 1.2.27
SNMP - 5.3.0.1
Plugins
  • Global Plugin Settings (settings - v0.5)
    Thresholds (thold - v0.4.1)
    Device Monitoring (monitor - v0.9)
    PHP Network Weathermap (weathermap - v0.96a)
    Network Discovery (discovery - v0.9)
    Realtime Graph Viewer (realtime - v0.36)
    Host Info (hostinfo - v0.2)
    Network Tools (tools - v0.3)
    Update Checker (update - v0.4)
    Watermark (watermark - v0.1)
    Uptime (uptime - v0.3)
    PHP Network Managing (PHP Network Managing - v0.6.1)
    CAMM (CActi Message Manager) (CAMM - v1.6.5)
galerien
Posts: 33
Joined: Wed Feb 11, 2009 12:16 pm
Location: Geneva

Post by galerien »

Now, I cannot create a rule from a syslog entry : when I click on "create a rule" from a syslog entry => I got the "rule" page but then nothing, the rule windows do not appear....

I will manually create a new rule and let you know...
galerien
Posts: 33
Joined: Wed Feb 11, 2009 12:16 pm
Location: Geneva

Post by galerien »

Here are the log when I try to create manally a new rule :

01/19/2010 12:31:09 PM - camm: Poller[0] php [camm_convert_json_to_sql_string] [sql_where]=[(facility is null AND priority is null)]

01/19/2010 12:31:09 PM - camm: Poller[0] php [getSQL] [operatorId]=[STRING_EQUAL] [fieldId]=[priority] [values]=[] [return]=[priority is null]

01/19/2010 12:31:09 PM - camm: Poller[0] php [getSQL] [operatorId]=[STRING_EQUAL] [fieldId]=[facility] [values]=[] [return]=[facility is null]

01/19/2010 12:31:09 PM - camm: Poller[0] php [camm_convert_json_to_sql_string] [raw_json_where]=[{\"left\":{\"fieldId\":\"facility\",\"operatorId\":\"STRING_EQUAL\",\"values\":[{\"label\":\"local7\",\"value\":\"local7\"}]},\"logicalOperator\":\"AND\",\"right\":{\"fieldId\":\"priority\",\"operatorId\":\"STRING_EQUAL\",\"values\":[{\"label\":\"crit\",\"value\":\"crit\"}]}}]
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests