add_graph.php duplicates

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
MisterG
Posts: 9
Joined: Mon May 10, 2010 4:44 am

add_graph.php duplicates

Post by MisterG »

Hello,

I use add_graphs.php to create graphs using templates. This CLI tool is automatically used by a daemon. After each intantiation it takes the ids returned by add_graphs.php to set the right rrd_path in the database.

When I check the results several problems occur :
- some datasources are not used in the right graphs (RAM <-> Swap for example) on a single host
- some datasources come from the same graph-template from an other host

Is it a bug or a misuse ?

Mathieu
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please show us some examples
R.
MisterG
Posts: 9
Joined: Mon May 10, 2010 4:44 am

Post by MisterG »

Here are the examples.
Attachments
Swap metric in RAM graph
Swap metric in RAM graph
swap_ram.png (15.17 KiB) Viewed 2218 times
ThreadPool 32 graph template with ThreadPool 31 data sources
ThreadPool 32 graph template with ThreadPool 31 data sources
thread_pool_bad_instance.png (27.78 KiB) Viewed 2218 times
ThreadPool 31 - everything OK
ThreadPool 31 - everything OK
thread_pool_ok_instance.png (27.15 KiB) Viewed 2218 times
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

MisterG wrote:Here are the examples.
Thanks; please provide the commands you used to create the graphs from cli as well. Please add some "--list*" outputs as well
R.
MisterG
Posts: 9
Joined: Mon May 10, 2010 4:44 am

Post by MisterG »

Here are the logs :
- add_graph.log : the CLI command
- list-graph-templates.log : the graph templates
- list-hosts.log : my hosts list

I don't have any input fields.
Attachments
list-hosts.log.gz
The hosts
(896 Bytes) Downloaded 86 times
list-graph-templates.log.gz
The graph templates
(1.21 KiB) Downloaded 83 times
add_graph.log.gz
The CLI log
(27.21 KiB) Downloaded 79 times
sor
Posts: 3
Joined: Fri May 21, 2010 8:32 pm

Post by sor »

I'm experiencing something similar. I'll create a device (testvm1), which is a server, add some graphs to it, add it to a tree, and everything is fine. I am using the CLI, but I'm not certain that the issue is CLI specific. If I delete that device through the GUI, selecting the options to delete everything referencing it, it goes away. However, when I create a second device (renji), with the same IP address as the testvm1 was using, the rrd files updated/used have the name of the old device. This messes things up quite a bit because I've got separate scripts that use the rrd files to create graphs based on the file names.

There is also a second situation, where reusing an IP causes it to fail in creating the rrd files. I'm not sure what the difference is between the two instances, but the only time the system works properly is if I create a device with an IP that cacti has never seen. I did check the 'host' table before and after, and everything seems fine.

At this point I'm trying to find which portion of the database is remembering the IP address as the old name. I think that's the key, at least in my situation. When I delete testvm1, cacti should know nothing about that host, doesn't make sense that it would see the IP of the new host and use the old name.

I am running 0.8.7e. Here is an example of the script along with example output:

Code: Select all


/usr/bin/php -q add_device.php --description=$guest-$custid --ip=$ip_private --template=9 --version=3 --username=snmpuser --password=$snmppass --authproto=SHA --privproto='[None]'

device id:51

/usr/bin/php -q add_graphs.php --host-id=$devid --graph-type=cg --graph-template-id=4

Graph Added - graph-id: (352) - data-source-ids: (533, 534, 535, 536)

/usr/bin/php -q add_graphs.php --host-id=$devid --graph-type=cg --graph-template-id=37

Graph Added - graph-id: (353) - data-source-ids: (537)

/usr/bin/php -q add_graphs.php --host-id=$devid --list-snmp-queries

Known SNMP Queries:(id, name)
1	SNMP - Interface Statistics
2	ucd/net -  Get Monitored Partitions
3	Karlnet - Wireless Bridge Statistics
4	Netware - Get Available Volumes
6	Unix - Get Mounted Partitions
7	Netware - Get Processor Information
8	SNMP - Get Mounted Partitions
9	SNMP - Get Processor Information
10	SNMP - Get Disk IO

/usr/bin/php -q add_graphs.php --host-id=$devid --list-snmp-fields

Known SNMP Fields for host-id 51: (name)
hrDiskIODescr
hrDiskIOIndex
ifAlias
ifDescr
ifHwAddr
ifIndex
ifIP
ifName
ifOperStatus
ifSpeed
ifType

/usr/bin/php -q add_graphs.php --host-id=$devid --graph-type=ds --graph-template-id=56 --snmp-query-id=1 --snmp-query-type-id=13 --snmp-field=ifName --snmp-value=eth0

Graph Added - graph-id: (354) - data-source-ids: (538, 538)

/usr/bin/php -q add_graphs.php --host-id=$devid --graph-type=ds --graph-template-id=56 --snmp-query-id=1 --snmp-query-type-id=13 --snmp-field=ifName --snmp-value=eth1

Graph Added - graph-id: (355) - data-source-ids: (539, 539)

/usr/bin/php -q add_graphs.php --host-id=$devid --graph-type=ds --graph-template-id=35 --snmp-query-id=10 --snmp-query-type-id=23 --snmp-field=hrDiskIODescr --snmp-value=vda

Graph Added - graph-id: (356) - data-source-ids: (540, 540)

/usr/bin/php -q add_graphs.php --host-id=$devid --graph-type=ds --graph-template-id=36 --snmp-query-id=10 --snmp-query-type-id=24 --snmp-field=hrDiskIODescr --snmp-value=vda

Graph Added - graph-id: (357) - data-source-ids: (541, 541)

/usr/bin/php -q add_graphs.php --host-id=$devid --graph-type=cg --graph-template-id=11

Graph Added - graph-id: (358) - data-source-ids: (542, 543, 544)

/usr/bin/php -q add_tree.php --type=node --node-type=host --tree-id=3 --host-id=$devid

Added Node node-id: (56)
Attachments
cactiproblem1.png
cactiproblem1.png (53.4 KiB) Viewed 2135 times
pheonix
Posts: 1
Joined: Wed Jul 28, 2010 9:01 am

Post by pheonix »

Hello,

After upgrading to last stable version, we are still having this issue.

I tried to import data from 5 different templates containing several datasources.
Each rrd and template is OK, but there's something wrong with the link between datasources and templates.
(i'm looking into the create_complete_graph_from_template function..)

Any help apreciated.

See the traces (all 5 data_templates points to the same datas) :

$ grep "RRDs::update" /var/log/n2cacti/debug.log | sed 's/^.*VSL\(.*\)rrd.*/VSL\1rrd/g' |sort -u
VSLRIOH31CBE_JVM/HeapFreeCurrent.rrd
VSLRIOH31CBE_JVM/HeapSizeCurrent.rrd
VSLRIOH31CBE_Lniata_VSC/NbFreeLniatas.rrd
VSLRIOH31CBE_Lniata_VSC/NbLniatasInPool.rrd
VSLRIOH31CBE_Lniata_VSC/NbMaxUsedLniatas.rrd
VSLRIOH31CBE_ThreadPool/busyThrdCurrCnt.rrd
VSLRIOH31CBE_ThreadPool/stuckThrdCurrCnt.rrd
VSLRIOH31CBE_ThreadPool/totalThrdCurrCnt.rrd
VSLRIOH32CBE_JVM/HeapFreeCurrent.rrd
VSLRIOH32CBE_JVM/HeapSizeCurrent.rrd
VSLRIOH32CBE_Lniata_VSC/NbFreeLniatas.rrd
VSLRIOH32CBE_Lniata_VSC/NbLniatasInPool.rrd
VSLRIOH32CBE_Lniata_VSC/NbMaxUsedLniatas.rrd
VSLRIOH32CBE_ThreadPool/busyThrdCurrCnt.rrd
VSLRIOH32CBE_ThreadPool/stuckThrdCurrCnt.rrd
VSLRIOH32CBE_ThreadPool/totalThrdCurrCnt.rrd
VSLRIOH33CBE_JVM/HeapFreeCurrent.rrd
VSLRIOH33CBE_JVM/HeapSizeCurrent.rrd
VSLRIOH33CBE_Lniata_VSC/NbFreeLniatas.rrd
VSLRIOH33CBE_Lniata_VSC/NbLniatasInPool.rrd
VSLRIOH33CBE_Lniata_VSC/NbMaxUsedLniatas.rrd
VSLRIOH33CBE_ThreadPool/busyThrdCurrCnt.rrd
VSLRIOH33CBE_ThreadPool/stuckThrdCurrCnt.rrd
VSLRIOH33CBE_ThreadPool/totalThrdCurrCnt.rrd
VSLRIOH34CBE_JVM/HeapFreeCurrent.rrd
VSLRIOH34CBE_JVM/HeapSizeCurrent.rrd
VSLRIOH34CBE_Lniata_VSC/NbFreeLniatas.rrd
VSLRIOH34CBE_Lniata_VSC/NbLniatasInPool.rrd
VSLRIOH34CBE_Lniata_VSC/NbMaxUsedLniatas.rrd
VSLRIOH34CBE_ThreadPool/busyThrdCurrCnt.rrd
VSLRIOH34CBE_ThreadPool/stuckThrdCurrCnt.rrd
VSLRIOH34CBE_ThreadPool/totalThrdCurrCnt.rrd
VSLRIOH35CBE_JVM/HeapFreeCurrent.rrd
VSLRIOH35CBE_JVM/HeapSizeCurrent.rrd
VSLRIOH35CBE_Lniata_VSC/NbFreeLniatas.rrd
VSLRIOH35CBE_Lniata_VSC/NbLniatasInPool.rrd
VSLRIOH35CBE_Lniata_VSC/NbMaxUsedLniatas.rrd
VSLRIOH35CBE_ThreadPool/busyThrdCurrCnt.rrd
VSLRIOH35CBE_ThreadPool/stuckThrdCurrCnt.rrd
VSLRIOH35CBE_ThreadPool/totalThrdCurrCnt.rrd


mysql> SELECT id,name,data_source_path FROM data_template_data WHERE local_data_id>0 ;
+-----+-----------------------------------------------------------------+----------------------------------------------------------------------------+
| id | name | data_source_path |
+-----+-----------------------------------------------------------------+----------------------------------------------------------------------------+
| 73 | |host_description| - VSLRIOH31CBE_JVM - HeapFreeCurrent | /var/www/html/cacti/rra/Riola/VSLRIOH31CBE_JVM/HeapFreeCurrent.rrd |
| 74 | |host_description| - VSLRIOH31CBE_JVM - HeapSizeCurrent | /var/www/html/cacti/rra/Riola/VSLRIOH31CBE_JVM/HeapSizeCurrent.rrd |
| 79 | |host_description| - VSLRIOH31CBE_Lniata_VSC - NbFreeLniatas | /var/www/html/cacti/rra/Riola/VSLRIOH31CBE_Lniata_VSC/NbFreeLniatas.rrd |
| 80 | |host_description| - VSLRIOH31CBE_Lniata_VSC - NbLniatasInPool | /var/www/html/cacti/rra/Riola/VSLRIOH31CBE_Lniata_VSC/NbLniatasInPool.rrd |
| 81 | |host_description| - VSLRIOH31CBE_Lniata_VSC - NbMaxUsedLniatas | /var/www/html/cacti/rra/Riola/VSLRIOH31CBE_Lniata_VSC/NbMaxUsedLniatas.rrd |
| 86 | |host_description| - VSLRIOH31CBE_ThreadPool - busyThrdCurrCnt | /var/www/html/cacti/rra/Riola/VSLRIOH31CBE_ThreadPool/busyThrdCurrCnt.rrd |
| 87 | |host_description| - VSLRIOH31CBE_ThreadPool - stuckThrdCurrCnt | /var/www/html/cacti/rra/Riola/VSLRIOH31CBE_ThreadPool/stuckThrdCurrCnt.rrd |
| 88 | |host_description| - VSLRIOH31CBE_ThreadPool - totalThrdCurrCnt | /var/www/html/cacti/rra/Riola/VSLRIOH31CBE_ThreadPool/totalThrdCurrCnt.rrd |
| 92 | |host_description| - VSLRIOH31CBE_JVM - HeapFreeCurrent | /var/www/html/cacti/rra/Riola/VSLRIOH31CBE_JVM/HeapFreeCurrent.rrd |
| 93 | |host_description| - VSLRIOH31CBE_JVM - HeapSizeCurrent | /var/www/html/cacti/rra/Riola/VSLRIOH31CBE_JVM/HeapSizeCurrent.rrd |
| 98 | |host_description| - VSLRIOH31CBE_Lniata_VSC - NbFreeLniatas | /var/www/html/cacti/rra/Riola/VSLRIOH31CBE_Lniata_VSC/NbFreeLniatas.rrd |
| 99 | |host_description| - VSLRIOH31CBE_Lniata_VSC - NbLniatasInPool | /var/www/html/cacti/rra/Riola/VSLRIOH31CBE_Lniata_VSC/NbLniatasInPool.rrd |
| 100 | |host_description| - VSLRIOH31CBE_Lniata_VSC - NbMaxUsedLniatas | /var/www/html/cacti/rra/Riola/VSLRIOH31CBE_Lniata_VSC/NbMaxUsedLniatas.rrd |
| 105 | |host_description| - VSLRIOH31CBE_ThreadPool - busyThrdCurrCnt | /var/www/html/cacti/rra/Riola/VSLRIOH31CBE_ThreadPool/busyThrdCurrCnt.rrd |
| 106 | |host_description| - VSLRIOH31CBE_ThreadPool - stuckThrdCurrCnt | /var/www/html/cacti/rra/Riola/VSLRIOH31CBE_ThreadPool/stuckThrdCurrCnt.rrd |
| 107 | |host_description| - VSLRIOH31CBE_ThreadPool - totalThrdCurrCnt | /var/www/html/cacti/rra/Riola/VSLRIOH31CBE_ThreadPool/totalThrdCurrCnt.rrd |
| 111 | |host_description| - VSLRIOH31CBE_JVM - HeapFreeCurrent | /var/www/html/cacti/rra/Riola/VSLRIOH31CBE_JVM/HeapFreeCurrent.rrd |
| 112 | |host_description| - VSLRIOH31CBE_JVM - HeapSizeCurrent | /var/www/html/cacti/rra/Riola/VSLRIOH31CBE_JVM/HeapSizeCurrent.rrd |
| 117 | |host_description| - VSLRIOH31CBE_Lniata_VSC - NbFreeLniatas | /var/www/html/cacti/rra/Riola/VSLRIOH31CBE_Lniata_VSC/NbFreeLniatas.rrd |
| 118 | |host_description| - VSLRIOH31CBE_Lniata_VSC - NbLniatasInPool | /var/www/html/cacti/rra/Riola/VSLRIOH31CBE_Lniata_VSC/NbLniatasInPool.rrd |
| 119 | |host_description| - VSLRIOH31CBE_Lniata_VSC - NbMaxUsedLniatas | /var/www/html/cacti/rra/Riola/VSLRIOH31CBE_Lniata_VSC/NbMaxUsedLniatas.rrd |
| 124 | |host_description| - VSLRIOH31CBE_ThreadPool - busyThrdCurrCnt | /var/www/html/cacti/rra/Riola/VSLRIOH31CBE_ThreadPool/busyThrdCurrCnt.rrd |
| 125 | |host_description| - VSLRIOH31CBE_ThreadPool - stuckThrdCurrCnt | /var/www/html/cacti/rra/Riola/VSLRIOH31CBE_ThreadPool/stuckThrdCurrCnt.rrd |
| 126 | |host_description| - VSLRIOH31CBE_ThreadPool - totalThrdCurrCnt | /var/www/html/cacti/rra/Riola/VSLRIOH31CBE_ThreadPool/totalThrdCurrCnt.rrd |
| 130 | |host_description| - VSLRIOH31CBE_JVM - HeapFreeCurrent | /var/www/html/cacti/rra/Riola/VSLRIOH31CBE_JVM/HeapFreeCurrent.rrd |
| 131 | |host_description| - VSLRIOH31CBE_JVM - HeapSizeCurrent | /var/www/html/cacti/rra/Riola/VSLRIOH31CBE_JVM/HeapSizeCurrent.rrd |
| 136 | |host_description| - VSLRIOH31CBE_Lniata_VSC - NbFreeLniatas | /var/www/html/cacti/rra/Riola/VSLRIOH31CBE_Lniata_VSC/NbFreeLniatas.rrd |
| 137 | |host_description| - VSLRIOH31CBE_Lniata_VSC - NbLniatasInPool | /var/www/html/cacti/rra/Riola/VSLRIOH31CBE_Lniata_VSC/NbLniatasInPool.rrd |
| 138 | |host_description| - VSLRIOH31CBE_Lniata_VSC - NbMaxUsedLniatas | /var/www/html/cacti/rra/Riola/VSLRIOH31CBE_Lniata_VSC/NbMaxUsedLniatas.rrd |
| 143 | |host_description| - VSLRIOH31CBE_ThreadPool - busyThrdCurrCnt | /var/www/html/cacti/rra/Riola/VSLRIOH31CBE_ThreadPool/busyThrdCurrCnt.rrd |
| 144 | |host_description| - VSLRIOH31CBE_ThreadPool - stuckThrdCurrCnt | /var/www/html/cacti/rra/Riola/VSLRIOH31CBE_ThreadPool/stuckThrdCurrCnt.rrd |
| 145 | |host_description| - VSLRIOH31CBE_ThreadPool - totalThrdCurrCnt | /var/www/html/cacti/rra/Riola/VSLRIOH31CBE_ThreadPool/totalThrdCurrCnt.rrd |
| 149 | |host_description| - VSLRIOH31CBE_JVM - HeapFreeCurrent | /var/www/html/cacti/rra/Riola/VSLRIOH31CBE_JVM/HeapFreeCurrent.rrd |
| 150 | |host_description| - VSLRIOH31CBE_JVM - HeapSizeCurrent | /var/www/html/cacti/rra/Riola/VSLRIOH31CBE_JVM/HeapSizeCurrent.rrd |
| 155 | |host_description| - VSLRIOH31CBE_Lniata_VSC - NbFreeLniatas | /var/www/html/cacti/rra/Riola/VSLRIOH31CBE_Lniata_VSC/NbFreeLniatas.rrd |
| 156 | |host_description| - VSLRIOH31CBE_Lniata_VSC - NbLniatasInPool | /var/www/html/cacti/rra/Riola/VSLRIOH31CBE_Lniata_VSC/NbLniatasInPool.rrd |
| 157 | |host_description| - VSLRIOH31CBE_Lniata_VSC - NbMaxUsedLniatas | /var/www/html/cacti/rra/Riola/VSLRIOH31CBE_Lniata_VSC/NbMaxUsedLniatas.rrd |
| 162 | |host_description| - VSLRIOH31CBE_ThreadPool - busyThrdCurrCnt | /var/www/html/cacti/rra/Riola/VSLRIOH31CBE_ThreadPool/busyThrdCurrCnt.rrd |
| 163 | |host_description| - VSLRIOH31CBE_ThreadPool - stuckThrdCurrCnt | /var/www/html/cacti/rra/Riola/VSLRIOH31CBE_ThreadPool/stuckThrdCurrCnt.rrd |
| 164 | |host_description| - VSLRIOH31CBE_ThreadPool - totalThrdCurrCnt | /var/www/html/cacti/rra/Riola/VSLRIOH31CBE_ThreadPool/totalThrdCurrCnt.rrd |
+-----+-----------------------------------------------------------------+----------------------------------------------------------------------------+
40 rows in set (0.00 sec)
Attachments
dump.sql.gz
Cacti Database dump
(69.39 KiB) Downloaded 63 times
debug.log.bz2.gz
Cacti debug Log
(1.29 MiB) Downloaded 72 times
info.log.gz
Cacti Info.log with add_graphs.php calls
(481 Bytes) Downloaded 79 times
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: add_graph.php duplicates

Post by gandalf »

I do not understand the construct you've used.
First, the data input method looks weird; no input and no output (the last one being a problem, IMHO).
Second, you've created a lot of data templates and graph templates that look very similar. IMHO, a single one would be ok (e.g. only one Nagios - JVM - HeapFreeCurrent independent of the host you're using).
Please tell us what your goal is and I'll help you out. Yes, I know that I'm late, but I'm just running through all stuff I've put onto my pile
R.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re:

Post by gandalf »

sor wrote:I'm experiencing something similar. I'll create a device (testvm1), which is a server, add some graphs to it, add it to a tree, and everything is fine. I am using the CLI, but I'm not certain that the issue is CLI specific. If I delete that device through the GUI, selecting the options to delete everything referencing it, it goes away. However, when I create a second device (renji), with the same IP address as the testvm1 was using, the rrd files updated/used have the name of the old device. This messes things up quite a bit because I've got separate scripts that use the rrd files to create graphs based on the file names.
We lately fixed some issues with referential integrity handling. I don't exactly remember if that was on 087g or on upcoming 087h. So I recommend waiting for 087h to reproduce this isse (I was not able to reproduce on current SVN code).
R.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest