Closed miguelangelcastellanos closed 6 years ago
What are the differences when you do this either way? If you edit the graph, device, data sources for the device that works and the one that doesn't?
In Cacti 1.x, if you have automation enabled, all Graph Template graphs will be created automatically. However, I do not understand how/why this is happening. The installer uses add_graphs.php and it's working just fine.
I just tested with the exact two templates on a new install, and I can not reproduce this. Is this a system upgrade, or a new install? If an upgrade, please re-import the Net-SNMP device package using the 'import_package.php' script in the CLI directory and try again.
Hello,
Thanks for your answers.
I tried to figure out the differences between the graphs created manually or using the CLI interface but I did not find anything obvious in the interface, however I noticed than when creating graphs manually, the system asks for "Legend Colors" and "Data Source Profile" I did not find an equivalent way to inform those parameters using add_graphs.php (CLI). Also this is new to cacti 1.X, in previous versions graphs were created without asking for additional information.
This is a new installation.
I am using SNMP Version 1.
Please confirm which cacti version you used when you mentioned that were unable to reproduce the problem.
Best regards,
Miguel
When manually creating graphs, the system will ask for the color due to the template setting, but the graph does have a default and the system will use the default when automation is used. So, that is a red herring. Have you imported the package yet and tried again?
Hello,
Now I understand why you were unable to replicate the problem.
So my conclusions are:
So I guess there is some weird time depending behaviour in the graph creation code.
I hope this information helps to improve cacti.
Thanks a lot for your time and help.
Miguel
Miguel,
The delay should have nothing to do with it. Once the CLI is returned to the user, all the db changes have been made. So, it has to be something else. Since everything is working for you now, I'll go ahead and close this in any event. Keep us posted if you find anything in the future that needs our attention. You can always open a separate ticket for that.
The only thought I had about this is that there could be a timing issue where the listing of a table for items is getting cross contaminated but if that was the case, we'd have issues with the GUI too.
Right
_Hi Miguel, may you please specified what directory/file in your statement "I solved the problem by executing a "sleep 30" command between each invocation to addgraphs.php"... I am still a newbie in cacti.. I am also encountering same problem..
Hello,
I use CLI scripts to automate device, tree and graph creation. They worked fine with 0.8X versions of cacti.
When trying to use the same approach in Fedora 27 Server ( PHP 7.1 + CACTI 1.1.33 + Maria DB 10.2) graphs created using the GUI work fine, but if I create them using the CLI interface, only NaN values appear.
Here is an example of the commands I executed to create graphs:
/usr/bin/php add_device.php --description=cacti --ip=XXX --template=4 --version=1 --community=public --avail=snmp Adding cacti (169.254.6.9) as "Net-SNMP Device" using SNMP v1 with community "public" Success - new device-id: (5) /usr/bin/php poller_reindex_hosts.php --id=5 WARNING: Do not interrupt this script. Reindexing can take quite some time ..... Adding graph Net-SNMP - Load Average /usr/bin/php add_graphs.php --host-id=5 --graph-type=cg --graph-template-id=19 /usr/bin/php /var/www/cacti/cli/add_tree.php --tree-id=3 --type=node --graph-id=34 --parent-node=18 --node-type=graph Added Node node-id: (40)
Adding graphs Net-SNMP - CPU Utilization /usr/bin/php add_graphs.php --host-id=5 --graph-type=cg --graph-template-id=23 /usr/bin/php /var/www/cacti/cli/add_tree.php --tree-id=3 --type=node --graph-id=38 --parent-node=16 --node-type=graph Added Node node-id: (44)
But the resulting graph created this wat only shows NaN values:
The same happened to Memory, Disk or network graphs. but if I create the host and graphs manually using the GUI, everything works fine.
The cacti log file gave me no clue, the only weird thing I saw in the log is the following line, which repeats very frequently:
02/07/2018 14:30:02 - PHPSVR WARNING: PHP Script File to be included, does not exist 02/07/2018 14:30:02 - PHPSVR WARNING: Function does not exist INC: '' FUNC: '' PARMS: ''
Thanks a lot for your time and help.
Please let me know if you need any additional information.
Miguel