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

Unable to create graphs due to Data Source verification failure #4250

Closed
ssvenn opened this issue May 5, 2021 · 84 comments
Closed

Unable to create graphs due to Data Source verification failure #4250

ssvenn opened this issue May 5, 2021 · 84 comments
Assignees
Labels
bug Undesired behaviour resolved A fixed issue
Milestone

Comments

@ssvenn
Copy link

ssvenn commented May 5, 2021

I ran into the problem with "Damaged Graph" on 1.2.16 after editing my new templates for Brocade FC switches, and tried to fix it by upgrading to 1.2.17 - this didn't help so i erased the rrd files, reset the database and started from scratch with my exported template

I am seeing strange behaviour where only some of my queried interfaces are being created, most fail with the text
"NOTE: Graph not for Data Query and index due to Data Source verification failure.

Rolling back to 1.2.16 and resetting the database again I was able to use the template to create graphs without getting this error message, and spine is able to collect values.

cacti_data_query_brocade_fcmgmt_switch.zip

Screenshot 2021-05-05 at 19 21 51

Steps to reproduce the behavior:

  1. Import the included templates

  2. Create a Brocade FC Switch device

  3. Create graphs from the the Brocade FCMGMT Switch query

@ssvenn ssvenn added bug Undesired behaviour unverified Some days we don't have a clue labels May 5, 2021
@ssvenn
Copy link
Author

ssvenn commented May 6, 2021

This might be related to feature#645: Modify automation to test for data before creating graphs

the 64-bit traffic counter on Brocade switches respond with Hex-String data on these OIDs that only work correctly with Spine, the PHP poller seems unable to convert it to numerical values.

snmpwalk -m FCMGMT-MIB -v2c -cpublic 192.168.1.10 .1.3.6.1.3.94.4.5.1.7 -O fn
.1.3.6.1.3.94.4.5.1.7.16.0.0.5.51.253.167.72.0.0.0.0.0.0.0.0.1 = Hex-STRING: 00 00 03 AB A0 BA 1D CC
.1.3.6.1.3.94.4.5.1.7.16.0.0.5.51.253.167.72.0.0.0.0.0.0.0.0.2 = Hex-STRING: 00 00 05 4A EE 5E 3B 24
.1.3.6.1.3.94.4.5.1.7.16.0.0.5.51.253.167.72.0.0.0.0.0.0.0.0.3 = Hex-STRING: 00 00 02 0D 66 93 01 68

https://forums.cacti.net/viewtopic.php?f=21&t=61663 has some more background

@Lejooohn
Copy link

Lejooohn commented May 7, 2021

Hi,

After upgrade from 1.2.16 to 1.2.17 i have a similar problem with ucd/net template :

Screenshot_1

Someone have a solution to fix that or we have to wait a next update?

Regards,

@xmacan
Copy link
Member

xmacan commented May 7, 2021

@Lejooohn please show result of snmpwalk:
snmpwalk -c YOUR_COMMUNITY HOST_IP_ADDRESS 1.3.6.1.4.1.2021.4

@Lejooohn
Copy link

Lejooohn commented May 7, 2021

@Lejooohn please show result of snmpwalk:
snmpwalk -c YOUR_COMMUNITY HOST_IP_ADDRESS 1.3.6.1.4.1.2021.4

Hello @xmacan ,

Below, the output :

UCD-SNMP-MIB::memIndex.0 = INTEGER: 0
UCD-SNMP-MIB::memErrorName.0 = STRING: swap
UCD-SNMP-MIB::memTotalSwap.0 = INTEGER: 2047996 kB
UCD-SNMP-MIB::memAvailSwap.0 = INTEGER: 2047996 kB
UCD-SNMP-MIB::memTotalReal.0 = INTEGER: 4041112 kB
UCD-SNMP-MIB::memAvailReal.0 = INTEGER: 3264592 kB
UCD-SNMP-MIB::memTotalFree.0 = INTEGER: 5312588 kB
UCD-SNMP-MIB::memMinimumSwap.0 = INTEGER: 16000 kB
UCD-SNMP-MIB::memShared.0 = INTEGER: 5524 kB
UCD-SNMP-MIB::memBuffer.0 = INTEGER: 2392 kB
UCD-SNMP-MIB::memCached.0 = INTEGER: 549568 kB
UCD-SNMP-MIB::memSwapError.0 = INTEGER: noError(0)
UCD-SNMP-MIB::memSwapErrorMsg.0 = STRING:

Regards,

John

@ssvenn
Copy link
Author

ssvenn commented May 7, 2021

I think a refinement of this data validation feature would be to stop the automatic countdown on that dialog box so that users have more time to act on it, and add a "force create graphs" checkbox somewhere as a workaround for edge cases like mine where Spine polls valid data while PHP does not.

@netniV
Copy link
Member

netniV commented May 8, 2021

The idea behind the automated countdown is to prevent you from needing to press anything to continue, but in this case it does sound like it needs to be a manual process. Can you paste a screenshot of the exact dialog you had, if it isn't this one?

image

@ssvenn
Copy link
Author

ssvenn commented May 8, 2021

Yes it is that dialog box, I just had to cut off the bottom to hide some host names. My environment is currently rolled back to 1.2.16 but I can set up a new instance on 1.2.17 to test more if you need more details.

Validating that a data source produces usable values is definitely a good idea to help users avoid empty graphs and poller errors, but when a graph fails to create it would be good to get a clear and detailed cause. Perhaps just send the text from this dialog box to the log file and some more debug information including the actual polled value and what's wrong with it (empty value, snmp error, invalid data type etc)

@netniV
Copy link
Member

netniV commented May 8, 2021

Yeah, I think I am going to rope @TheWitness in here to give a comment or two just because I'm not 100% clear yet on how that is working and he'll be able to answer it better than me. Between us, we should be able to come up with a way to do that.

@simonpunk
Copy link

simonpunk commented May 11, 2021

@netniV
That's possibly the same issue as mind: #4246, still no comments tho...
Anyway, I think the root cause is the defined template custom data field is used for the mechanism rather than the newly defined custom data field when user trying to create a graph. In Chrome debug session, I see it sends correct post value with my input after clicking the create graph button, but seems the php code looks up the databases input instead.

@ssvenn @Lejooohn I have tried to modify or insert a pre-defined value for my custom data field in databases, and it works, as well as creating another data source template with a pre-defined value for all the data field.

So the scene is like: even you are giving different value for your custom data fields, when you click create button, it doesn't take your input into account but instead the pre-defined input from your data source template. So only when the output returns no 'U' from your data source template will let you keep going.

@zuka1337
Copy link

Same here, 2 diferent types of error when creating any custom graph

First:

<html>
<body>
<!--StartFragment-->

2021-05-13 16:36:53 - CMDPHP PHP ERROR NOTICE Backtrace: (/graphs_new.php[42]:form_save(), /graphs_new.php[150]:html_graph_new_graphs(), /lib/html_graph.php[442]:html_graph_custom_data(), /lib/html_graph.php[573]:draw_nontemplated_fields_graph_item(), /lib/html_form_template.php[252]:draw_edit_form(), /lib/html_form.php[114]:draw_edit_control(), /lib/html_form.php[330]:CactiErrorHandler())
--
2021-05-13 16:36:53 - ERROR PHP NOTICE: Undefined index: value in file: /cacti/lib/html_form.php on line: 330
2021-05-13 16:36:53 - CMDPHP PHP ERROR NOTICE Backtrace: (/graphs_new.php[42]:form_save(), /graphs_new.php[150]:html_graph_new_graphs(), /lib/html_graph.php[442]:html_graph_custom_data(), /lib/html_graph.php[573]:draw_nontemplated_fields_graph_item(), /lib/html_form_template.php[181]:CactiErrorHandler())
2021-05-13 16:36:53 - ERROR PHP NOTICE: Undefined index: color_id in file: /cacti/lib/html_form_template.php on line: 181
2021-05-13 16:36:53 - CMDPHP PHP ERROR NOTICE Backtrace: (/graphs_new.php[42]:form_save(), /graphs_new.php[150]:html_graph_new_graphs(), /lib/html_graph.php[442]:html_graph_custom_data(), /lib/html_graph.php[573]:draw_nontemplated_fields_graph_item(), /lib/html_form_template.php[180]:CactiErrorHandler())
2021-05-13 16:36:53 - ERROR PHP NOTICE: Undefined index: color_id in file: /cacti/lib/html_form_template.php on line: 180

<!--EndFragment-->
</body>
</html>

Second:
image

@zuka1337
Copy link

zuka1337 commented May 13, 2021

And becomes impossible to add devices by cli with an associated template Device containning graphs that cannot be created by this error:

/usr/bin/php -q /cacti/cli/add_device.php --description=HOSTNAME--ip=IP --community=CM --template=X--version=2 --port=161 --avail=pingsnmp --disable=1

USAGE: snmpget [OPTIONS] AGENT OID [OID]...

  Version:  5.8
  Web:      http://www.net-snmp.org/
  Email:    net-snmp-coders@lists.sourceforge.net

OPTIONS:
  -h, --help            display this help message
  -H                    display configuration file directives understood
  -v 1|2c|3             specifies SNMP version to use
  -V, --version         display package version number
SNMP Version 1 or 2c specific
  -c COMMUNITY          set the community string
SNMP Version 3 specific
  -a PROTOCOL           set authentication protocol (MD5|SHA|SHA-224|SHA-256|SHA-384|SHA-512)
  -A PASSPHRASE         set authentication protocol pass phrase
  -e ENGINE-ID          set security engine ID (e.g. 800000020109840301)
  -E ENGINE-ID          set context engine ID (e.g. 800000020109840301)
  -l LEVEL              set security level (noAuthNoPriv|authNoPriv|authPriv)
  -n CONTEXT            set context name (e.g. bridge1)
  -u USER-NAME          set security name (e.g. bert)
  -x PROTOCOL           set privacy protocol (DES|AES|AES-192|AES-256)
  -X PASSPHRASE         set privacy protocol pass phrase
  -Z BOOTS,TIME         set destination engine boots/time
General communication options
  -r RETRIES            set the number of retries
  -t TIMEOUT            set the request timeout (in seconds)
Debugging
  -d                    dump input/output packets in hexadecimal
  -D[TOKEN[,...]]       turn on debugging output for the specified TOKENs
                           (ALL gives extremely verbose debugging output)
General options
  -m MIB[:...]          load given list of MIBs (ALL loads everything)
  -M DIR[:...]          look in given list of directories for MIBs
    (default: /root/.snmp/mibs:/usr/share/snmp/mibs)
  -P MIBOPTS            Toggle various defaults controlling MIB parsing:
                          u:  allow the use of underlines in MIB symbols
                          c:  disallow the use of "--" to terminate comments
                          d:  save the DESCRIPTIONs of the MIB objects
                          e:  disable errors when MIB symbols conflict
                          w:  enable warnings when MIB symbols conflict
                          W:  enable detailed warnings when MIB symbols conflict
                          R:  replace MIB symbols from latest module
  -O OUTOPTS            Toggle various defaults controlling output display:
                          0:  print leading 0 for single-digit hex characters
                          a:  print all strings in ascii format
                          b:  do not break OID indexes down
                          e:  print enums numerically
                          E:  escape quotes in string indices
                          f:  print full OIDs on output
                          n:  print OIDs numerically
                          p PRECISION:  display floating point values with specified PRECISION (printf format string)
                          q:  quick print for easier parsing
                          Q:  quick print with equal-signs
                          s:  print only last symbolic element of OID
                          S:  print MIB module-id plus last element
                          t:  print timeticks unparsed as numeric integers
                          T:  print human-readable text along with hex strings
                          u:  print OIDs using UCD-style prefix suppression
                          U:  don't print units
                          v:  print values only (not OID = value)
                          x:  print all strings in hex format
                          X:  extended index format
  -I INOPTS             Toggle various defaults controlling input parsing:
                          b:  do best/regex matching to find a MIB node
                          h:  don't apply DISPLAY-HINTs
                          r:  do not check values for range/type legality
                          R:  do random access to OID labels
                          u:  top-level OIDs must have '.' prefix (UCD-style)
                          s SUFFIX:  Append all textual OIDs with SUFFIX before parsing
                          S PREFIX:  Prepend all textual OIDs with PREFIX before parsing
  -L LOGOPTS            Toggle various defaults controlling logging:
                          e:           log to standard error
                          o:           log to standard output
                          n:           don't log at all
                          f file:      log to the specified file
                          s facility:  log to syslog (via the specified facility)

                          (variants)
                          [EON] pri:   log to standard error, output or /dev/null for level 'pri' and above
                          [EON] p1-p2: log to standard error, output or /dev/null for levels 'p1' to 'p2'
                          [FS] pri token:    log to file/syslog for level 'pri' and above
                          [FS] p1-p2 token:  log to file/syslog for levels 'p1' to 'p2'
  -C APPOPTS            Set various application specific behaviours:
                          f:  do not fix errors and retry the request
No hostname specified.

At the end you're still gonna ending up with the device added, but the erros will mess your eyes.
The input scripts runs fine manually

Note: Nothing is bad with snmp (I know you're thinking :D)

@xmacan
Copy link
Member

xmacan commented May 13, 2021

@zuka1337 I have similar problem problem Try this: console -> Templates -> Graph -> Edit one of your problematic graphs (Fan or memory heap) -> tick any checkbox (I tried upper limit, it does not matter). Try to create graphs again and let me know.

@TheWitness
Copy link
Member

Sorry guys, been taking a break. Needed some time off. Tried getting this remediated over the weekend, but my computer took one look at me and ran for the hills.

@TheWitness
Copy link
Member

@zuka1337 that seems like a separate issue to me. If it's not logged already, please log it.

@zuka1337
Copy link

@TheWitness we all need break after some time :D
ok I've open another issue #4273

@netadmin101
Copy link

Hello, are there any workarounds for this until a fix is released? I tried what @xmacan suggested with no luck. We add ~5 new devices a day and I'm getting quite a list I need to circle back to with interfaces that need graphs created. Everything else in 1.2.17 seems fine so I hate to revert just for this one thing.

Thanks!

@TheWitness
Copy link
Member

TheWitness commented May 27, 2021

You can short circuit the test function and always make it true. It'll bypass the tests. It would be good to get a screen print of the data and graph templates causing issues, and if a script, get a screen shot of the data input method.

@TheWitness
Copy link
Member

The function is called test_data_source grep for it.

@netadmin101
Copy link

Thanks for the tip about making that function true. That definitely fixes the problem.

We're just using the standard "Interface - Traffic" data template and "Interface - Traffic (bits/sec, 95th Percentile) graph template. I've attached screenshots of what they all look like, let me know if you want to see any more. I'm happy to help troubleshoot.

data-source-template
graph-template-part1
graph-template-part2
graph-template-part3
create-graphs
create-graphs-error

@UH-Nerion
Copy link

Hello,

I have the same problem.
Any workaround?
We can not add our graphs.

Thanks

@xmacan
Copy link
Member

xmacan commented Jun 2, 2021

Try this workaround:
In file lib/function.php
around the line 1619 is:

function test_data_source($data_template_id, $host_id, $snmp_query_id = 0, $snmp_index = '') {
           global $called_by_script_server;

          $called_by_script_server = true;

Add one line:

function test_data_source($data_template_id, $host_id, $snmp_query_id = 0, $snmp_index = '') {
           global $called_by_script_server;
            return true;
            $called_by_script_server = true;

@UH-Nerion
Copy link

Hello,

many thanks. It's working!

@netniV
Copy link
Member

netniV commented Jun 3, 2021

Clearly we need to review the test_data_source function to see why it fails so much more than expected.

@xmacan
Copy link
Member

xmacan commented Jun 3, 2021

@netniV Maybe add button "Test only" to graphs_new.php. Just as it is used for inport templates.

@Susanin63
Copy link
Contributor

In file lib\functions.php:1753 change:

array($data_template_id, $data_template_id)),
to
array($data_input['data_template_data_id'], $data_input['data_template_data_id'])),

@Susanin63
Copy link
Contributor

array($data_template_id, $data_template_id)),

@netadmin101
Copy link

I just updated here as well, also seeing this issue return in the latest version 1.2.18. We rarely saw the bad data problem, the common one for us is "due to Data Source verification failure"

image

@eschoeller
Copy link

Upgraded to 1.2.18 over here and this is still really broken for me. I can't make any new graphs. I might need to downgrade, since I'm dead in the water now because of this data source validation issue.

2021/07/16 22:07:15 - ERROR PHP NOTICE: Undefined index: cg in file: /cacti/cacti-1.2.18-prod/lib/template.php  on line: 1723
2021/07/16 22:07:15 - CMDPHP PHP ERROR NOTICE Backtrace:  (/graphs_new.php[42]:form_save(), /graphs_new.php[150]:html_graph_new_graphs(), /lib/html_graph.php[465]:host_new_graphs_save(), /graphs_new.php[243]:create_save_graph(), /lib/template.php[1723]:CactiErrorHandler())
2021/07/16 22:07:15 - DSV test_data_source = {"data_template_id":"366","host_id":861,"snmp_query_id":0,"snmp_index":"","suggested_vals":null}
2021/07/16 22:07:15 - DSV data_input = {"id":"58","type_id":"1","data_template_data_id":"13185","data_template_id":"366","active":"on","rrd_step":"60","name":"System Activity Reporter"}
2021/07/16 22:07:15 - DSV host = {"id":"861","poller_id":"1","site_id":"0","host_template_id":"50","description":"test","hostname":"test.colorado.edu","location":"","notes":"","external_id":"","snmp_community":"test","snmp_version":"2","snmp_username":"","snmp_password":"","snmp_auth_protocol":"","snmp_priv_passphrase":"","snmp_priv_protocol":"","snmp_context":"","snmp_engine_id":"","snmp_port":"161","snmp_timeout":"1500","snmp_sysDescr":"Linux test 4.19.0-17-amd64 #1 SMP Debian 4.19.194-2 (2021-06-21) x86_64","snmp_sysObjectID":"iso.3.6.1.4.1.8072.3.2.10","snmp_sysUpTimeInstance":"113964523","snmp_sysContact":"test","snmp_sysName":"test","snmp_sysLocation":"Boulder","availability_method":"2","ping_method":"1","ping_port":"23","ping_timeout":"400","ping_retries":"1","max_oids":"60","bulk_walk_size":"-1","device_threads":"6","deleted":"","disabled":"","monitor":"on","monitor_text":"","status":"3","status_event_count":"0","status_fail_date":"0000-00-00 00:00:00","status_rec_date":"2021-07-15 20:01:11","status_last_error":"Device did not respond to SNMP","min_time":"0.76103","max_time":"29.11401","cur_time":"1.10793","avg_time":"1.13460","polling_time":"0.153","total_polls":"2117","failed_polls":"575","availability":"72.83890","last_updated":"2021-07-16 22:06:36"}
2021/07/16 22:07:15 - DSV script_path = perl /cacti/cacti-1.2.18-prod/scripts/sarfetch.pl '' '2' 'public' '161' '1500'
2021/07/16 22:07:15 - DSV num_output_fields_sql = SELECT SQL_NO_CACHE id FROM data_input_fields WHERE data_input_id = ? AND input_output = "out" AND update_rra="on"
2021/07/16 22:07:15 - DSV num_output_fields = 34
2021/07/16 22:07:15 - DSV data_source_item_name = 
2021/07/16 22:07:15 - DSV script_path = perl /cacti/cacti-1.2.18-prod/scripts/sarfetch.pl '' '2' 'public' '161' '1500'
2021/07/16 22:07:16 - DSV output =

@bmfmancini
Copy link
Member

bmfmancini commented Jul 17, 2021 via email

@netadmin101
Copy link

@eschoeller Try this: in lib/functions.php, change line 1728 from the test_data_sources function from return false to return true. That's the workaround I'm currently using.

@eschoeller
Copy link

Yup I found that fix and meant to update my comment but got sidetracked onto other things. The work-around is really simple ... it essentially disables the entire data source verification function. I think I was involved in the discussion(s) where this function originated from - due in part to automation creating graphs that end up having no data - but I think a LOT more testing needs to occur to get this working right. Perhaps it needs to be marked experimental for now and manually enabled in the settings until all the issues can be tested and worked out. Having any errors with this function has a pretty negative impact on the overall functionality of the software, especially when it's included in the last two major releases.

@gj00354347
Copy link

Hi Team ,

we also upgraded cacti to 1.2.18 in Test and observed similar issues. Although there is no hard and fast rule like when it works and when not .
so we enabled the log verbosity to Debug in cacti and found below lines .

2021-07-21 15:54:46 - ERROR PHP NOTICE: Undefined index: cg in file: /opt/SP/cacti/cacti/lib/template.php on line: 1723
2021-07-21 15:54:46 - CMDPHP PHP ERROR NOTICE Backtrace: (/graphs_new.php[42]:form_save(), /graphs_new.php[150]:html_graph_new_graphs(), /lib/html_graph.php[465]:host_new_graphs_save(), /graphs_new.php[243]:create_save_graph(), /lib/template.php[1723]:CactiErrorHandler())

PFB snap
graph-creation-error-snap

Best Regards,
Gopal

@bernisys
Copy link
Contributor

As my colleague just wrote, we also see the "Bad data" error here, and some graphs are not created. I've looked a bit deeper into it while he was writing the comment and I'm not sure about the source, but as he points out, we're seeing this behavior:

In cacti/lib/template.php in function create_save_graph() on line 1723 we get an error for an undefined index "cg" in the "values" array - this could be a hint.

The function is called by cacti/graphs_new.php in line 243 after the $values array is filled. But filling $values depends on the loop thru the "$_POST" variable, which seems to be a built-in in PHP, containing the form as given by the "POST" HTML transfer method. If that POST was empty, the array would not have been created.

Haven't looked too deeply into it, but it could be a hint.
@netniV does that ring a bell maybe?

We will go for the workaround now, as this function is critical to us.
Maybe a bit more data-sanitizing code would be nice in cacti .. for example, checking if the variables contain valid data, and if not, give us a bit of side-info in the logs, so that it is easier to relate things to each other.

@netniV
Copy link
Member

netniV commented Jul 21, 2021

Basically, the form that creates the selection list, sets various field names and when selected, these are POST'd to back. Those are then split apart to generate the various elements. If you are using v1.2.18, make sure you have the latest lib/functions.php from the 1.2.x branch and see if you get exactly the same error.

@gj00354347
Copy link

gj00354347 commented Jul 21, 2021

Hi Team ,

we also see one strange behavior like the graph template associated with a host templates should be drawn the moment we add the device under the right template .
but what we observed is like no graph are created even for the ones whose graph template is associated with host template and we see in device edit page like "NOT BEING GRAPHED" .

we tried to sync the device to device template but that did not work .

yes we tried a few work around like we removed the association of device with existing Host template and assigned a generic template and then again assigned the right (previous template) template and Bingo all were there !!

and I enabled debug log as well as developer log but could not get anything in the logs . PFB snap I see in DEVICE EDIT PAGE

associated-graph-templates-not-created

yes we have tried the work around suggested below but this failure of graphs associated with device template even doesnt work after applying the workaround. The only work around at our disposal is like break the existing association of device with present template and associate with some other host template and again associate it with previous template and all the graphs are created associated with that host template . this is really strange behaviour.
like in the first go , all the graphs associated with that host template should have been created when we add a device under a host template but this do not happen in our case.

we are on cacti 1.2.18 including the change in lib/functions.php ,"change line 1728 from the test_data_sources function from return false to return true".

Best Regards,
Gopal

@bernisys
Copy link
Contributor

If you are using v1.2.18, make sure you have the latest lib/functions.php from the 1.2.x branch and see if you get exactly the same error.

Ok we will do so in our test environment, while we are pushing out 1.2.18 already in prod, using the workaround to skip the data source validation. This gives us a bit of time to observe in an uncritical environment.

@skyjou
Copy link
Contributor

skyjou commented Sep 8, 2021

This issue still exist.

@chrcoluk
Copy link

Hi guys just a "me too" post.

I think this needs to be treated as experimental and in a new version of cacti changed to off by default, it for sure needs to be made optional, instead of havng to hack the source code.

@will60113
Copy link

my cacti is Version 1.2.18.
I've already solved this problem by editing the config, and finally the graph template can show up.

But another problem comes up, some of the source cannot be graphed, the graphs are still empty.
(all of them are Windows server 2012 R2)
empty graph
3gv12

@ARC1450
Copy link

ARC1450 commented Oct 18, 2021

Not sure this is closed and fixed.

I have some graph templates that are supposed to be empty. They're graph templates that have up to 4 items that can be graphed (specifically, I'm pulling IPMI sensor data, and when you have a couple of different motherboards with OOB, you can have different numbers of fans on each).

I create each individual fan sensor graph, then go back and delete the graph, leaving the data source. Then I tie the data source to the empty graph template and presto, rinse and repeat 3 to 4 times, and presto. . .I can either have 3 or 4 fan IPMI systems that use the same graph template.

The fix that bypassed this error:

The Operation was successful.  Details are below.

Graph Not created for IPMI Fans (4 Sensors) due to bad data

was to hop into vim, search for "test_data_sources", set it to always return "true", and I was able to create my empty graph template.

On a side note, I've noticed that what users used to be able to do (this, for example) are being "checked" to make sure they're not bad. Just because a graph template doesn't have an existing data source doesn't mean it's a bad graph template. I've ran into other issues where I've had to edit the underlying PHP to create graphs I've been able to create in the past (the ucd/net Memory graph is one such graph, I believe) that now Cacti refuses to create for some reason.

@netniV
Copy link
Member

netniV commented Oct 18, 2021

The issue raised in this post was identified and fixed. There have been a few other corner cases that have also been fixed so the test_data_sources should be working a lot better when 1.2.19 is released. That is still undergoing testing to make sure we are happy with it as one or two more issues have been raised in other areas that require some testing prior to release.

@TheWitness
Copy link
Member

In 1.2.19, you will be able to mark the Graph Templates to be tested first prior to creation.

image

This way, if you have a Data Source that takes 20 seconds to test and create 1000 graphs based upon it, you won't have to wait 20,000 seconds for the GUI to respond. That is an extreme to prove the point of adding the setting.

@ARC1450
Copy link

ARC1450 commented Oct 18, 2021

Awesome! Thanks Witness!

I know y'all are basically making things idiot-proof. It's just a little frustrating when things work for 2, 3, or 4 years then suddenly poof. . they don't work and you have to go digging on Dr. Google only to find someone say "well, it was decided that we should be checking this, that, and another; you are a corner case".

I realize there are corner cases, but maybe a toggle on the configuration/settings page for "development" and "production" could be implemented, where the "development" removes all the sanity checking and "idiot-proofing" being done, and "production" only allows for extremely safe, expected conditions. That's the way I've seen it done for a lot of systems I work on (I'm in IT) because, well, some admins are power users that can make their own templates/queries.

@TheWitness
Copy link
Member

I'm notorious for breaking things and that release broke things bigly.

@ctrowat
Copy link
Contributor

ctrowat commented Oct 20, 2021

We are also stuck on this issue (running 1.2.18) and as a result cannot create any graphs for any device. I am not sure what to think there, at the crux of it (for us at least) is that the interfaces.xml snmp query file contains all the possible OIDs to query, but not every device supports every OID, so this is failing to create graphs for one thing because the device does not support another. Would it be possible to make the test specific to the graph being created?

@jchambers777
Copy link

Hi Team ,

we also see one strange behavior like the graph template associated with a host templates should be drawn the moment we add the device under the right template . but what we observed is like no graph are created even for the ones whose graph template is associated with host template and we see in device edit page like "NOT BEING GRAPHED" .

we tried to sync the device to device template but that did not work .

yes we tried a few work around like we removed the association of device with existing Host template and assigned a generic template and then again assigned the right (previous template) template and Bingo all were there !!

and I enabled debug log as well as developer log but could not get anything in the logs . PFB snap I see in DEVICE EDIT PAGE

associated-graph-templates-not-created

yes we have tried the work around suggested below but this failure of graphs associated with device template even doesnt work after applying the workaround. The only work around at our disposal is like break the existing association of device with present template and associate with some other host template and again associate it with previous template and all the graphs are created associated with that host template . this is really strange behaviour. like in the first go , all the graphs associated with that host template should have been created when we add a device under a host template but this do not happen in our case.

we are on cacti 1.2.18 including the change in lib/functions.php ,"change line 1728 from the test_data_sources function from return false to return true".

Best Regards, Gopal

Thank you so much this worked for me

@TheWitness
Copy link
Member

@jchambers777,

This should all be fixed up on the 1.2.20 release that we are nearing the release of. Might even be able to get it out ahead of time depending on all our holiday schedules. Have to play wait and see. If you are daring, you can just update to the 1.2.x branch.

cd /var/www/html
git clone -b 1.2.x https://github.com/cacti/cacti.git cacti.new
/bin/cp -rpf cacti.new/* cacti
chown -R apache:apache cacti

Then, refresh your browser (F5 on Windows). If there are any updates, they will come from people like yourself testing.

TheWitness

@jchambers777
Copy link

@jchambers777,

This should all be fixed up on the 1.2.20 release that we are nearing the release of. Might even be able to get it out ahead of time depending on all our holiday schedules. Have to play wait and see. If you are daring, you can just update to the 1.2.x branch.

cd /var/www/html
git clone -b 1.2.x https://github.com/cacti/cacti.git cacti.new
/bin/cp -rpf cacti.new/* cacti
chown -R apache:apache cacti

Then, refresh your browser (F5 on Windows). If there are any updates, they will come from people like yourself testing.

TheWitness

I was wondering do you think upgrading to this specific one will correct my issue?
Here is what I am facing now: ERROR: opening C:/Apache24/htdocs/cacti/rra/cacti_server_boost_peak_memory_4.rrd
the system cannot find the file.

It just seems like it's not creating the graphs in the specified area so cacti is looking for them, but they don't appear in that area.

Thanks for replying to me I do appreciate it.

@TheWitness
Copy link
Member

I suspect it's a permission issue. I've not used Windows in so long that I dread even working on it again. Our windows guy is busy bouncing around his young children too. From experience, there is not much time for Cacti when they are young.

Cacti "calculates" the base_path in the poller (or used to). Go into the database and run this command, then check permissions:

SELECT * FROM settings WHERE name LIKE '%path%';

You'll be looking for path_webroot, I'm pretty sure.

@TheWitness
Copy link
Member

The repair script will fix the damaged graph. It's easier for me to say take it all vs. cherry picking files. It's real stable now.

@jchambers777
Copy link

jchambers777 commented Dec 13, 2021 via email

@bmfmancini
Copy link
Member

bmfmancini commented Dec 13, 2021 via email

@TheWitness
Copy link
Member

Actually, you should consider the 1.2.x branch. It's just about ready for release. After that, it should work well.

@jchambers777
Copy link

jchambers777 commented Dec 14, 2021 via email

@github-actions github-actions bot locked and limited conversation to collaborators Mar 15, 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