Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional information to help when creating graphs from templates #4516

Closed
alcatron opened this issue Dec 26, 2021 · 22 comments
Closed
Labels
bug Undesired behaviour resolved A fixed issue
Milestone

Comments

@alcatron
Copy link

Im Running some custom graphs to monitor hard drive temperature on synology NAS device which worked fine in 1.2.17... now when i want to add additional disk temperature graphs in 1.2.19 i am seeing this error..

This happens when clicking on "Create" graphs button. Some bug i suppose in graphs_new.php ?

`
26-12-2021 14:27:23 - CMDPHP PHP ERROR WARNING Backtrace: (/graphs_new.php[68]:graphs(), /graphs_new.php[778]:CactiErrorHandler())

26-12-2021 14:27:23 - ERROR PHP WARNING: Invalid argument supplied for foreach() in file: /usr/share/cacti/graphs_new.php on line: 778
26-12-2021 14:27:23 - CMDPHP PHP ERROR NOTICE Backtrace: (/graphs_new.php[68]:graphs(), /graphs_new.php[778]:CactiErrorHandler())
26-12-2021 14:27:23 - ERROR PHP NOTICE: Undefined index: fields in file: /usr/share/cacti/graphs_new.php on line: 778
26-12-2021 14:27:23 - CMDPHP PHP ERROR WARNING Backtrace: (/graphs_new.php[68]:graphs(), /graphs_new.php[625]:CactiErrorHandler())
26-12-2021 14:27:23 - ERROR PHP WARNING: Invalid argument supplied for foreach() in file: /usr/share/cacti/graphs_new.php on line: 625
26-12-2021 14:27:23 - CMDPHP PHP ERROR NOTICE Backtrace: (/graphs_new.php[68]:graphs(), /graphs_new.php[625]:CactiErrorHandler())
26-12-2021 14:27:23 - ERROR PHP NOTICE: Undefined index: fields in file: /usr/share/cacti/graphs_new.php on line: 625
`

@alcatron alcatron added bug Undesired behaviour unverified Some days we don't have a clue labels Dec 26, 2021
@TheWitness TheWitness changed the title Bug creating graphs in 1.2.19 Unable to create Graphs due to one of the following Data Query Issues: permissions, incorrectly formatted, or missing XML file Dec 29, 2021
@TheWitness TheWitness removed the unverified Some days we don't have a clue label Dec 29, 2021
@TheWitness TheWitness added this to the v1.2.20 milestone Dec 29, 2021
@TheWitness
Copy link
Member

I'm marking this as confirmed, but the source of the problem is likely user error. Check the renaming of the issue for more clues.

TheWitness added a commit that referenced this issue Dec 29, 2021
Unable to create Graphs due to one of the following Data Query Issues: permissions, incorrectly formatted, or missing XML file
@TheWitness TheWitness added the resolved A fixed issue label Dec 29, 2021
TheWitness added a commit that referenced this issue Dec 29, 2021
Give users some clue as to the source of the issue.
@TheWitness
Copy link
Member

I have updated the error message to help in diagnosis.

@alcatron
Copy link
Author

Still didnt make any difference, updating the new graphs_new.php file

30-12-2021 20:39:33 - CMDPHP PHP ERROR WARNING Backtrace: (/graphs_new.php[68]:graphs(), /graphs_new.php[778]:CactiErrorHandler())
30-12-2021 20:39:33 - ERROR PHP WARNING: Invalid argument supplied for foreach() in file: /usr/share/cacti/graphs_new.php on line: 778
30-12-2021 20:39:33 - CMDPHP PHP ERROR NOTICE Backtrace: (/graphs_new.php[68]:graphs(), /graphs_new.php[778]:CactiErrorHandler())
30-12-2021 20:39:33 - ERROR PHP NOTICE: Undefined index: fields in file: /usr/share/cacti/graphs_new.php on line: 778
30-12-2021 20:39:33 - CMDPHP PHP ERROR WARNING Backtrace: (/graphs_new.php[68]:graphs(), /graphs_new.php[625]:CactiErrorHandler())
30-12-2021 20:39:33 - ERROR PHP WARNING: Invalid argument supplied for foreach() in file: /usr/share/cacti/graphs_new.php on line: 625
30-12-2021 20:39:33 - CMDPHP PHP ERROR NOTICE Backtrace: (/graphs_new.php[68]:graphs(), /graphs_new.php[625]:CactiErrorHandler())
30-12-2021 20:39:33 - ERROR PHP NOTICE: Undefined index: fields in file: /usr/share/cacti/graphs_new.php on line: 625

@alcatron
Copy link
Author

Note, the existing graphs are working fine, its only when new ones to create, ive checked permissions and nothing has changed

@TheWitness
Copy link
Member

Hmm, okay.

@TheWitness
Copy link
Member

Okay, that's quite odd. For the host in question, can you please verify the XML files for each Data Query and make sure that the XML file has valid syntax and is readable. Below is an example where you will find "fields". Every XML file should have it and in your case, there is one Data Query where either the XML file is not correct, or is missing that data. I can add more 'debug' to more closely isolate the specific data query also.

image

TheWitness added a commit that referenced this issue Dec 30, 2021
This will trigger an error message when a problem with the XML files is seen.
@TheWitness
Copy link
Member

I updated the graphs_new.php to throw an error and let you know which data query has a bad or missing XML file. Please apply and report back.

@alcatron
Copy link
Author

ok , what you did is good, keep that debug modification, now it pops up an error

Sorry, we could not process your last action.
Error Parsing Data Query Resource XML file for Data Query 'Synology - disk ID' with id '10'

@alcatron
Copy link
Author

question is whats the reason for the error.. i just tried the same template in 0.8 cacti and it works fine, can it give anymore details why its erroring the parsing ?

@alcatron
Copy link
Author

alcatron commented Dec 31, 2021

I turned on debug for the individual nas device and now i see errors like this, when i re-index the device

31-12-2021 11:59:16 - ERROR PHP NOTICE: Undefined index: fields in file: /usr/share/cacti/lib/data_query.php on line: 2273
31-12-2021 11:58:44 - REINDEX ERROR: Re-Indexing failed due to a NULL sort field for Device[Synology NAS] and DQ[Synology - disk ID]. Can not continue with Re-Index.
31-12-2021 11:58:44 - CMDPHP PHP ERROR WARNING Backtrace: (/host.php[116]:host_reload_query(), /host.php[574]:run_data_query(), /lib/data_query.php[106]:query_snmp_host(), /lib/data_query.php[917]:CactiErrorHandler())
31-12-2021 11:58:44 - ERROR PHP WARNING: Invalid argument supplied for foreach() in file: /usr/share/cacti/lib/data_query.php on line: 917
31-12-2021 11:58:44 - CMDPHP PHP ERROR NOTICE Backtrace: (/host.php[116]:host_reload_query(), /host.php[574]:run_data_query(), /lib/data_query.php[106]:query_snmp_host(), /lib/data_query.php[917]:CactiErrorHandler())
31-12-2021 11:58:44 - ERROR PHP NOTICE: Undefined index: fields in file: /usr/share/cacti/lib/data_query.php on line: 917
31-12-2021 11:58:44 - CMDPHP PHP ERROR NOTICE Backtrace: (/host.php[116]:host_reload_query(), /host.php[574]:run_data_query(), /lib/data_query.php[106]:query_snmp_host(), /lib/data_query.php[869]:CactiErrorHandler())
31-12-2021 11:58:44 - ERROR PHP NOTICE: Undefined index: oid_index in file: /usr/share/cacti/lib/data_query.php on line: 869
31-12-2021 11:58:44 - ERROR PHP NOTICE: Undefined index: oid_index in file: /usr/share/cacti/lib/data_query.php on line: 813
31-12-2021 11:58:43 - CMDPHP PHP ERROR NOTICE Backtrace: (/host.php[116]:host_reload_query(), /host.php[574]:run_data_query(), /lib/data_query.php[106]:query_snmp_host(), /lib/data_query.php[813]:CactiErrorHandler())
31-12-2021 11:58:43 - ERROR PHP NOTICE: Undefined index: oid_index in file: /usr/share/cacti/lib/data_query.php on line: 813

@TheWitness
Copy link
Member

Upload the device template and xml file.

@TheWitness
Copy link
Member

So, to be clear, you will upload >= 2 XML files.

@alcatron
Copy link
Author

alcatron commented Jan 1, 2022

Here they are:

cacti_host_template_synology_nas.txt = is the main template

these sit in /cacti/resource/snmp_queries
synology_snmp_diskid.txt
synology_disk_temp.txt

synology_disk_temp.txt
cacti_host_template_synology_nas.txt
synology_snmp_diskid.txt

@TheWitness
Copy link
Member

TheWitness commented Jan 3, 2022

Worked fine for me. You have placed the wrong file into the <path_cacti>/resource/snmp_queries/ directory. The file in your uploads synology_disk_temp.txt should be in that directory with the name synology_snmp_diskid.xml. So, it's a simple error to fix. I have a Synology NAS and once all the files are correctly in place, everything works. So, this is a PEBKAC. Closing now. We have better error handling now anyway.

@TheWitness
Copy link
Member

There appear to be other issues. I'm going a little further down the rabbit hole.

@TheWitness
Copy link
Member

Here is the second big issue. Goto this page on your system. Do you see the same thing?

image

@TheWitness
Copy link
Member

I guess we should disable the "checkboxes" when this problem is encountered.

@TheWitness
Copy link
Member

Going to make another commit to help users when they encounter these basket of issues.

TheWitness added a commit that referenced this issue Jan 3, 2022
This message will prevent a users from attempting to create a Graph for a Data Query that has not been finished, or is broken.
@TheWitness
Copy link
Member

Okay, think this is good enough now. Closing.

@alcatron
Copy link
Author

alcatron commented Jan 4, 2022

Hi Witness,

In the path <path_cacti>/resource/snmp_queries/ I have both files synology_disk_temp.xml and synology_snmp_diskid.xml , I just renamed the above to .txt so I can upload the files.
I have disks 1 - 5 graphing fine with this setup for past 2 years, the problem is when I wanted to add disk 6 to graph temperature cacti doesn't want to create the graph and creates the above error. The same in 0.8 cacti doesn't experience the issue.

The screenshot above of yours is the same as mine.

With your setup how many disks are you graphing ?

I still can't get it to work but 0.8 works fine same setup.

@TheWitness
Copy link
Member

Not sure how it works in that your device template export did not include all the components. Did you export from 0.8.x or did you export from 1.x? Also, your file synology_disk_diskid.xml is NOT a resource XML. Open a few of them and you will see what I'm talking about.

@TheWitness
Copy link
Member

@alcatron, FYI. I've added the Synology NAS (my version with two of your Templates) to the 1.2.20 release. You should look for it.

@netniV netniV changed the title Unable to create Graphs due to one of the following Data Query Issues: permissions, incorrectly formatted, or missing XML file Add additional information to help when creating graphs from templates Apr 3, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Dec 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Undesired behaviour resolved A fixed issue
Projects
None yet
Development

No branches or pull requests

2 participants