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

When editing Maximum OIDs Per Get Request, blank value can cause errors #3643

Closed
interduo opened this issue Jun 29, 2020 · 11 comments
Closed
Labels
resolved A fixed issue unverified Some days we don't have a clue
Milestone

Comments

@interduo
Copy link
Contributor

interduo commented Jun 29, 2020

Describe the bug

2020/06/29 13:20:57 - CMDPHP PHP ERROR WARNING Backtrace: (/host.php[137]:api_device_ping_device(), /lib/api_device.php[1045]:cacti_snmp_session(), /lib/snmp.php[86]:CactiErrorHandler())
--
2020/06/29 13:20:57 - ERROR PHP WARNING: cacti_snmp_session(): max_oids should be positive integer or NULL, got 0 in file: /var/www/html/cacti/lib/snmp.php on line: 86

To Reproduce

  1. Edit any Device.
  2. Delete value from: "Maximum OIDs Per Get Request" - leave field empty
  3. Submit form.

Expected behavior

No error :)

@interduo interduo added bug Undesired behaviour unverified Some days we don't have a clue labels Jun 29, 2020
@TheWitness
Copy link
Member

You don't mention a Cacti version @interduo. Code looks good. Somehow the host in question has a max_oids of 0, which should not be possible. You should look to how you added this device and trace how the max_oids became 0. My guess is that you are doing this external to Cacti.

@interduo
Copy link
Contributor Author

Sorry.
Branch: 1.2.x
Updated few days ago.

@interduo
Copy link
Contributor Author

My guess is that you are doing this external to Cacti.

No. I use only gui.

@TheWitness
Copy link
Member

SELECT COUNT(*) FROM host WHERE max_oids = 0;

@netniV
Copy link
Member

netniV commented Jun 29, 2020

select max_oids, count(*) from host group by max_oids;
+----------+----------+
| max_oids | count(*) |
+----------+----------+
|       10 |        3 |
+----------+----------+
1 row in set (0.00 sec)

Try that query, so we can see the split of the setting.

@interduo
Copy link
Contributor Author

interduo commented Jun 30, 2020

Thanks for the query. I changed all fields to 16.

As I see - You could set Maximum OIDs Per Get Request = 0 if You put 0 or leave empty field.
Is this value normal? The 0 value goes to DB.

And after that in:
https://cacti/host.php?action=edit&id=749&nostate=true ... as many times as I open this form:

2020/06/30 09:48:43 - CMDPHP PHP ERROR WARNING Backtrace: (/host.php[137]:api_device_ping_device(), /lib/api_device.php[1045]:cacti_snmp_session(), /lib/snmp.php[86]:CactiErrorHandler())
--
2020/06/30 09:48:43 - ERROR PHP WARNING: cacti_snmp_session(): max_oids should be positive integer or NULL, got 0 in file: /var/www/html/cacti/lib/snmp.php on line: 86
2020/06/30 09:48:43 - CMDPHP Updating 9 Data Source
2020/06/30 09:48:25 - CMDPHP PHP ERROR WARNING Backtrace: (/host.php[137]:api_device_ping_device(), /lib/api_device.php[1045]:cacti_snmp_session(), /lib/snmp.php[86]:CactiErrorHandler())
2020/06/30 09:48:25 - ERROR PHP WARNING: cacti_snmp_session(): max_oids should be positive integer or NULL, got 0 in file: /var/www/html/cacti/lib/snmp.php on line: 86


@interduo
Copy link
Contributor Author

interduo commented Jun 30, 2020

in mysql SHOW CREATE TABLE host shows
max_oids int(12) unsigned DEFAULT 10,

There is ``max_oids int(12) unsigned DEFAULT 10,
So I think that empty field should be 10 not 0.

@netniV
Copy link
Member

netniV commented Jul 4, 2020

what do you have for the setting 'max_get_size' ?

select * from settings where name = 'max_get_size';

@interduo
Copy link
Contributor Author

interduo commented Jul 7, 2020

MariaDB [cacti]> select * from settings where name = 'max_get_size';
+--------------+-------+
| name | value |
+--------------+-------+
| max_get_size | 16 |
+--------------+-------+
1 row in set (0.001 sec)

@github-actions
Copy link

github-actions bot commented Sep 6, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the outdated No recent activity label Sep 6, 2020
TheWitness added a commit that referenced this issue Sep 6, 2020
Maximum OIDs Per Get Request - field empty
@TheWitness TheWitness removed bug Undesired behaviour outdated No recent activity labels Sep 6, 2020
@TheWitness TheWitness added this to the 1.2.15 milestone Sep 6, 2020
@TheWitness TheWitness added the resolved A fixed issue label Sep 6, 2020
@TheWitness
Copy link
Member

Fixed.

@netniV netniV changed the title Maximum OIDs Per Get Request - field empty When editing Maximum OIDs Per Get Request, blank value can cause errors Nov 2, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Feb 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
resolved A fixed issue unverified Some days we don't have a clue
Projects
None yet
Development

No branches or pull requests

3 participants