Skip to content

Changing Multi-Device SNMP settings may not work as expected #4508

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

Closed
arno-st opened this issue Dec 17, 2021 · 26 comments
Closed

Changing Multi-Device SNMP settings may not work as expected #4508

arno-st opened this issue Dec 17, 2021 · 26 comments
Labels
bug Undesired behaviour resolved A fixed issue
Milestone

Comments

@arno-st
Copy link
Contributor

arno-st commented Dec 17, 2021

I have to change the settings of many switch, passing from snmp v2 to snmpv3, so I did on all the switch physically, but on cacti I'm selecting all devices, and do an action -> change settings.
Selecting the new community, is only half done.

Even if the information is set on the device, it's not really apply.
when I go to a device I got:
SNMP Information
Host SNMP error
Ping Results
ICMP Ping Success (0.87 ms)

And I have to go to each device to do a save to be sure the new settings is apply.

@arno-st arno-st added bug Undesired behaviour unverified Some days we don't have a clue labels Dec 17, 2021
@arno-st
Copy link
Contributor Author

arno-st commented Dec 17, 2021

Sorry Cacti 1.2.19

@TheWitness
Copy link
Member

What version 1.2.x?

@arno-st
Copy link
Contributor Author

arno-st commented Dec 17, 2021

Yup just give in the second post 1.2.19

@TheWitness
Copy link
Member

I'm working on this part of the code today. In the mean time, press the Repopulate Poller Cache link when editing the Device.

@TheWitness
Copy link
Member

Also, 1.2.x has a oush_out_hosts.php cli that'll let you do it enmass.

@arno-st
Copy link
Contributor Author

arno-st commented Dec 17, 2021

Hmm I don't think we have the same 1.2.x branch, I can't find any push_out_hosts.php on which folder it should be ?

@xmacan
Copy link
Member

xmacan commented Dec 17, 2021

<cacti_dir>/cli

@arno-st
Copy link
Contributor Author

arno-st commented Dec 17, 2021

nop!!
[xxxx:/usr/share/cacti/cli] # ls
add_data_query.php fix_mediumint.php rebuild_poller_cache.php
add_datasource.php host_update_template.php refresh_csrf.php
add_device.php import_package.php remove_device.php
add_graphs.php import_template.php remove_graphs.php
add_graph_template.php index.php removespikes.php
add_perms.php input_whitelist.php reorder_data_query.php
add_tree.php install_cacti.php repair_database.php
analyze_database.php md5sum.php repair_graphs.php
apply_automation_rules.php poller_data_sources_reapply_names.php repair_templates.php
audit_database.php poller_graphs_reapply_names.php splice_rrd.php
batchgapfix.php poller_output_empty.php sqltable_to_php.php
convert_tables.php poller_reindex_hosts.php structure_rra_paths.php
copy_user.php poller_replicate.php upgrade_database.php

@xmacan
Copy link
Member

xmacan commented Dec 17, 2021

Download it from
https://github.com/Cacti/cacti/tree/1.2.x/cli

@arno-st
Copy link
Contributor Author

arno-st commented Dec 17, 2021

When you said 'Repopulate Poller Cache link' you mean 'Rebuild Poller Cache'

Tha one with the warning about the time it can take to run ?

@TheWitness
Copy link
Member

TheWitness commented Dec 17, 2021

From GitHub, first switch to the 1.2.x branch, then drill Don into the code.

Or:

cd /var/www/html
git clone https://github.com/cacti/cacti.git cacti.new
cp cacti.new/cli/push_out_hosts.php cacti/cli

@TheWitness
Copy link
Member

The time it takes to run depends on the number of graphs. How many graphs for this one device?

@TheWitness
Copy link
Member

If it's less than 10k graphs, it should be pretty quick.

@arno-st
Copy link
Contributor Author

arno-st commented Dec 17, 2021

Ok no sure not 10k for one device ;)

So I run the script, but still the device is shown as :
SNMP Information
Host SNMP error
Ping Results
ICMP Ping Success (1.208 ms)

@TheWitness
Copy link
Member

Well that's something different. Remember, if using V3, we recommend you uninstall php-snmp and restart apache.

@arno-st
Copy link
Contributor Author

arno-st commented Dec 17, 2021

If I remember right I can't use net-snmp, their is some difference on how it handle some query, and that give me a lot of trouble on one of my plugin, that's whay back to 1.x

And except this little trouble everything is working fine with snmp-php

@bmfmancini
Copy link
Member

bmfmancini commented Dec 17, 2021 via email

@arno-st
Copy link
Contributor Author

arno-st commented Dec 17, 2021

No none nowhere !!

@TheWitness
Copy link
Member

Post output of

php -m

@arno-st
Copy link
Contributor Author

arno-st commented Dec 21, 2021

[root@lslcacp02:~] # php -m
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
json
ldap
libxml
mbstring
mcrypt
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
readline
Reflection
session
shmop
SimpleXML
sockets
SPL
sqlite3
ssh2
standard
sysvmsg
sysvsem
sysvshm
tidy
tokenizer
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache

@arno-st
Copy link
Contributor Author

arno-st commented Jan 11, 2022

By the way this situation has nothing to do with snmp, by my test you can change any value on more than 1 devices via the menu action, and It will be change when you look on the device but not applied.
Like it's missing something that happen when you do a save, but don't happen when you do a action -> change settings

@TheWitness
Copy link
Member

That was an important note. Thanks!

@TheWitness
Copy link
Member

Looking at the change settings API in the 1.2.x branch, those settings changes result in a call to push_out_host for each device. Which rebuilds the poller cache. So, something else must be happening. I would suggest maybe update to the 1.2.x branch and try again.

@TheWitness
Copy link
Member

One other thing. Are the devices being managed by another poller?

@arno-st
Copy link
Contributor Author

arno-st commented Jan 12, 2022

Harg I know what's wrong. It's me!

So sorry, let me explain:
I have a default configuration for the device that is SNMP V3 (on the menu Settings -> device default), but on old host/device it's still snmpV2. So when I change the config of the device (the real one, 10 at time), Then I go to cacti and just change the settings tell him to use snmp V3 (and just that), but when you do that with the menu action, it just change the setting of snmp version from V2 to V3, it dosen't adjust all other settings, like it does when you are on the host (on host you change snmp V2 to snmp V3 and it take the default value, fill the screen with it, then update the host, poller with all this new settings).

So if I change all SNMP settings from the action menu, it's works as it should be. So sorry!

So quick question: isn't a good option when you change the setting from the menu action, it take the default value if it exist ?
like it does act on host directly ?

TheWitness added a commit that referenced this issue Feb 5, 2022
Changing SNMP settings on a bunch of device via 'choose an action' is not applied
@TheWitness TheWitness added resolved A fixed issue and removed unverified Some days we don't have a clue labels Feb 5, 2022
@TheWitness TheWitness added this to the v1.2.20 milestone Feb 5, 2022
@TheWitness
Copy link
Member

Okay, @bmfmancini had the same issue and we were able to reproduce and work out a fix which is not committed. You should focus on lib/utility.php only

@netniV netniV changed the title Changin SNMP settings on a bunch of device via 'choose an action' is not applied Changing Multi-Device SNMP settings may not work as expected 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

4 participants