AutoM8 Question - Picking up Switch Interfaces it should not be
Moderators: Developers, Moderators
AutoM8 Question - Picking up Switch Interfaces it should not be
Hi all,
I have an autom8 rule (Graph Rule) to match any device containing a certain text in the hostname which works great, the next part of it matches to see if the current Interface status is Up/Up as well as some text in the interface description (aka ifAlias). This is done with the attached rule set. However when I run it its picking up interface that are Up/Down. Any idea what I have done wrong here.
I have an autom8 rule (Graph Rule) to match any device containing a certain text in the hostname which works great, the next part of it matches to see if the current Interface status is Up/Up as well as some text in the interface description (aka ifAlias). This is done with the attached rule set. However when I run it its picking up interface that are Up/Down. Any idea what I have done wrong here.
- Attachments
-
- Screenshot 2023-08-14 132626.jpg (87.63 KiB) Viewed 1898 times
System - Red Hat Enterprise
Cacti Version - 1.2.23
RRDTool - 1.7.0
Poller - CMD
[u]Plugins Installed[/u]
Monitor 2.5
ReportIT 1.1.3
Thold 1.7
Weathermap 1.0
Cacti Version - 1.2.23
RRDTool - 1.7.0
Poller - CMD
[u]Plugins Installed[/u]
Monitor 2.5
ReportIT 1.1.3
Thold 1.7
Weathermap 1.0
Re: AutoM8 Question - Picking up Switch Interfaces it should not be
You really need to add parenthesis around the or's. Otherwise the logic is wrong
Before history, there was a paradise, now dust.
Re: AutoM8 Question - Picking up Switch Interfaces it should not be
Have tried that and then I get no matches at all.
System - Red Hat Enterprise
Cacti Version - 1.2.23
RRDTool - 1.7.0
Poller - CMD
[u]Plugins Installed[/u]
Monitor 2.5
ReportIT 1.1.3
Thold 1.7
Weathermap 1.0
Cacti Version - 1.2.23
RRDTool - 1.7.0
Poller - CMD
[u]Plugins Installed[/u]
Monitor 2.5
ReportIT 1.1.3
Thold 1.7
Weathermap 1.0
Re: AutoM8 Question - Picking up Switch Interfaces it should not be
Show me what it looks like when you tried
Before history, there was a paradise, now dust.
Re: AutoM8 Question - Picking up Switch Interfaces it should not be
See below.
System - Red Hat Enterprise
Cacti Version - 1.2.23
RRDTool - 1.7.0
Poller - CMD
[u]Plugins Installed[/u]
Monitor 2.5
ReportIT 1.1.3
Thold 1.7
Weathermap 1.0
Cacti Version - 1.2.23
RRDTool - 1.7.0
Poller - CMD
[u]Plugins Installed[/u]
Monitor 2.5
ReportIT 1.1.3
Thold 1.7
Weathermap 1.0
Re: AutoM8 Question - Picking up Switch Interfaces it should not be
The first guy inside the bracket should not have an AND.
Before history, there was a paradise, now dust.
Re: AutoM8 Question - Picking up Switch Interfaces it should not be
Tried that and still getting no matches at all?
System - Red Hat Enterprise
Cacti Version - 1.2.23
RRDTool - 1.7.0
Poller - CMD
[u]Plugins Installed[/u]
Monitor 2.5
ReportIT 1.1.3
Thold 1.7
Weathermap 1.0
Cacti Version - 1.2.23
RRDTool - 1.7.0
Poller - CMD
[u]Plugins Installed[/u]
Monitor 2.5
ReportIT 1.1.3
Thold 1.7
Weathermap 1.0
Re: AutoM8 Question - Picking up Switch Interfaces it should not be
Show that screen capture?
Before history, there was a paradise, now dust.
Re: AutoM8 Question - Picking up Switch Interfaces it should not be
System - Red Hat Enterprise
Cacti Version - 1.2.23
RRDTool - 1.7.0
Poller - CMD
[u]Plugins Installed[/u]
Monitor 2.5
ReportIT 1.1.3
Thold 1.7
Weathermap 1.0
Cacti Version - 1.2.23
RRDTool - 1.7.0
Poller - CMD
[u]Plugins Installed[/u]
Monitor 2.5
ReportIT 1.1.3
Thold 1.7
Weathermap 1.0
Re: AutoM8 Question - Picking up Switch Interfaces it should not be
Approximately line 858 in lib/api_automation.php there is a SQL statement, add a cacti_log($row_query); of that statement and the go the sthe rule page. It should post the SQL. Grab it from the cacti.log and post it.
Before history, there was a paradise, now dust.
Re: AutoM8 Question - Picking up Switch Interfaces it should not be
This section?
$rule_name = db_fetch_cell_prepared('SELECT name
FROM automation_graph_rules
WHERE id = ?',
array($rule['id']));
$rule_name = db_fetch_cell_prepared('SELECT name
FROM automation_graph_rules
WHERE id = ?',
array($rule['id']));
System - Red Hat Enterprise
Cacti Version - 1.2.23
RRDTool - 1.7.0
Poller - CMD
[u]Plugins Installed[/u]
Monitor 2.5
ReportIT 1.1.3
Thold 1.7
Weathermap 1.0
Cacti Version - 1.2.23
RRDTool - 1.7.0
Poller - CMD
[u]Plugins Installed[/u]
Monitor 2.5
ReportIT 1.1.3
Thold 1.7
Weathermap 1.0
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Re: AutoM8 Question - Picking up Switch Interfaces it should not be
Right here, I actually added it for you.
- Attachments
-
- RowsQueryScreenShot.png (39.66 KiB) Viewed 1565 times
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Re: AutoM8 Question - Picking up Switch Interfaces it should not be
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Re: AutoM8 Question - Picking up Switch Interfaces it should not be
Got this in the logs.
2023-08-21 11:57:57 - CMDPHP SELECT * FROM (SELECT h.hostname AS automation_host, host_id, h.disabled, h.status, snmp_query_id, snmp_index , MAX(CASE WHEN field_name='ifAdminStatus' THEN field_value ELSE NULL END) AS 'ifAdminStatus', MAX(CASE WHEN field_name='ifAlias' THEN field_value ELSE NULL END) AS 'ifAlias', MAX(CASE WHEN field_name='ifDescr' THEN field_value ELSE NULL END) AS 'ifDescr', MAX(CASE WHEN field_name='ifHighSpeed' THEN field_value ELSE NULL END) AS 'ifHighSpeed', MAX(CASE WHEN field_name='ifHwAddr' THEN field_value ELSE NULL END) AS 'ifHwAddr', MAX(CASE WHEN field_name='ifIndex' THEN field_value ELSE NULL END) AS 'ifIndex', MAX(CASE WHEN field_name='ifIP' THEN field_value ELSE NULL END) AS 'ifIP', MAX(CASE WHEN field_name='ifName' THEN field_value ELSE NULL END) AS 'ifName', MAX(CASE WHEN field_name='ifOperStatus' THEN field_value ELSE NULL END) AS 'ifOperStatus', MAX(CASE WHEN field_name='ifSpeed' THEN field_value ELSE NULL END) AS 'ifSpeed', MAX(CASE WHEN field_name='ifType' THEN field_value ELSE NULL END) AS 'ifType' FROM host_snmp_cache AS hsc LEFT JOIN host AS h ON (hsc.host_id=h.id) LEFT JOIN host_template AS ht ON (h.host_template_id=ht.id) WHERE snmp_query_id=4 AND ( `h`.`description` LIKE '%c93%' OR `h`.`description` LIKE '%c38%' OR `h`.`description` LIKE '%c29%') GROUP BY host_id, snmp_query_id, snmp_index ORDER BY automation_host, CAST(snmp_index AS unsigned)) AS a WHERE ( a.`ifOperStatus` LIKE '%Up%' AND a.`ifAdminStatus` LIKE '%Up%' ( AND a.`ifAlias` LIKE '%//%' OR a.`ifAlias` LIKE '%Wireless%' OR a.`ifName` LIKE '%Stack%' ))
2023-08-21 11:57:57 - CMDPHP SELECT * FROM (SELECT h.hostname AS automation_host, host_id, h.disabled, h.status, snmp_query_id, snmp_index , MAX(CASE WHEN field_name='ifAdminStatus' THEN field_value ELSE NULL END) AS 'ifAdminStatus', MAX(CASE WHEN field_name='ifAlias' THEN field_value ELSE NULL END) AS 'ifAlias', MAX(CASE WHEN field_name='ifDescr' THEN field_value ELSE NULL END) AS 'ifDescr', MAX(CASE WHEN field_name='ifHighSpeed' THEN field_value ELSE NULL END) AS 'ifHighSpeed', MAX(CASE WHEN field_name='ifHwAddr' THEN field_value ELSE NULL END) AS 'ifHwAddr', MAX(CASE WHEN field_name='ifIndex' THEN field_value ELSE NULL END) AS 'ifIndex', MAX(CASE WHEN field_name='ifIP' THEN field_value ELSE NULL END) AS 'ifIP', MAX(CASE WHEN field_name='ifName' THEN field_value ELSE NULL END) AS 'ifName', MAX(CASE WHEN field_name='ifOperStatus' THEN field_value ELSE NULL END) AS 'ifOperStatus', MAX(CASE WHEN field_name='ifSpeed' THEN field_value ELSE NULL END) AS 'ifSpeed', MAX(CASE WHEN field_name='ifType' THEN field_value ELSE NULL END) AS 'ifType' FROM host_snmp_cache AS hsc LEFT JOIN host AS h ON (hsc.host_id=h.id) LEFT JOIN host_template AS ht ON (h.host_template_id=ht.id) WHERE snmp_query_id=4 AND ( `h`.`description` LIKE '%c93%' OR `h`.`description` LIKE '%c38%' OR `h`.`description` LIKE '%c29%') GROUP BY host_id, snmp_query_id, snmp_index ORDER BY automation_host, CAST(snmp_index AS unsigned)) AS a WHERE ( a.`ifOperStatus` LIKE '%Up%' AND a.`ifAdminStatus` LIKE '%Up%' ( AND a.`ifAlias` LIKE '%//%' OR a.`ifAlias` LIKE '%Wireless%' OR a.`ifName` LIKE '%Stack%' ))
System - Red Hat Enterprise
Cacti Version - 1.2.23
RRDTool - 1.7.0
Poller - CMD
[u]Plugins Installed[/u]
Monitor 2.5
ReportIT 1.1.3
Thold 1.7
Weathermap 1.0
Cacti Version - 1.2.23
RRDTool - 1.7.0
Poller - CMD
[u]Plugins Installed[/u]
Monitor 2.5
ReportIT 1.1.3
Thold 1.7
Weathermap 1.0
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Re: AutoM8 Question - Picking up Switch Interfaces it should not be
What does that query return? It looks kind of right.
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Who is online
Users browsing this forum: No registered users and 0 guests