Hello,
Is there a way to find out how many graphs a cacti device has using MySQL?
I have checked various tables, etc but without success.
I have a need to find out if a device has graphs. The issue comes from a user going
in to cacti, and changing the ip and not the device name, breaks the graphs.
The only way I have found to fix it - is to delete the graphs from the device with new ip
and recrete the graphs,
Any suggestions?
eholz1
[SOLVED]Use cacti mysql to find device graphs
Moderators: Developers, Moderators
[SOLVED]Use cacti mysql to find device graphs
Last edited by eholz1 on Thu May 14, 2020 2:57 pm, edited 1 time in total.
Re: Use cacti mysql to find device graphs
You can check into graph_local and make a linke with host using graph-local.host_id like that
SELECT * FROM host, graph_local WHERE host.id=graph_local.host_id AND host.id = 1
the host.id = 1 is the host you would like to have the graph listing
SELECT * FROM host, graph_local WHERE host.id=graph_local.host_id AND host.id = 1
the host.id = 1 is the host you would like to have the graph listing
Test
Almalinux
php 8.2.14
mariadb 10.6.16
Cacti 1.2.27
Spine 1.2.27
RRD 1.7.2
thold 1.8
monitor 2.5
syslog 3.2
flowview: 3.3
weathermap 1.0 Beta
Almalinux
php 8.2.14
mariadb 10.6.16
Cacti 1.2.27
Spine 1.2.27
RRD 1.7.2
thold 1.8
monitor 2.5
syslog 3.2
flowview: 3.3
weathermap 1.0 Beta
Re: Use cacti mysql to find device graphs
Or more optimized:
SELECT * FROM host INNER JOIN graph_local WHERE host.id=graph_local.host_id AND host.id = 1
SELECT * FROM host INNER JOIN graph_local WHERE host.id=graph_local.host_id AND host.id = 1
Test
Almalinux
php 8.2.14
mariadb 10.6.16
Cacti 1.2.27
Spine 1.2.27
RRD 1.7.2
thold 1.8
monitor 2.5
syslog 3.2
flowview: 3.3
weathermap 1.0 Beta
Almalinux
php 8.2.14
mariadb 10.6.16
Cacti 1.2.27
Spine 1.2.27
RRD 1.7.2
thold 1.8
monitor 2.5
syslog 3.2
flowview: 3.3
weathermap 1.0 Beta
Re: Use cacti mysql to find device graphs
Hello,
Thanks for both of these tips! I was close, but now it works with your info.
I figured it would take a couple of tables to resolve the issue.
Thanks Again,
Eholz1
Thanks for both of these tips! I was close, but now it works with your info.
I figured it would take a couple of tables to resolve the issue.
Thanks Again,
Eholz1
Who is online
Users browsing this forum: No registered users and 5 guests