12-03-2021 07:58 AM
We have over 100 CUCM clusters and need to query every one to ensure SNMP community string standard compliance. I see the getSNMPCommunityString API, but it needs a correct community string as a search criteria. We are trying to discover configured SNMP strings so we won't know. Thanks.
12-06-2021 07:51 AM - edited 12-06-2021 07:51 AM
The devices on our lab servers do not have geolocations, so I can't test this out, but I believe you get the community name from your device geolocation. Here's a snippet from the data dictionary. Note a3 is a string for the community name.
12-06-2021 01:09 PM
I believe the geolocations/community (a geographic community, e.g. 'SoHo') field is different from a configured SNMP community string.
Unfortunately, I can't seem to find a table in the UCM database that stores SNMP configuration. My suspicion is that the config is stored somewhere in an inaccessible OS configuration file (perhaps snmp.conf) and the CLI and AXL SNMP commands interact with the config data in a special/different way than the usual AXL database interaction.
You can certainly check for the existence of a required community string via <getSNMPCommunityString> - if it fails, it's not present, and you can go ahead and ahead the required one. However it seems a 'list' variation is not provided by AXL, so it's not possible to get a listing of all the strings, e.g. to check for unauthorized/misconfigured strings.
Perhaps you could use something like Paramiko to access UCM CLI remotely to execute commands, e.g. "utils snmp config 1/2c community-string list" and parse the text output. However, note this isn't a 'supported' programming interface (it's basically 'scraping' text output) so it may not be super reliable: e.g. an extra-long community string or one with a weird character might change how spaces/tabs/etc. are shown in the CLI, breaking a 'scraping' text parser...
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide