Due to an issue with our SNMP communities which contain a \ character i have to go through and manually change the snmp community on the dat source. I have worked out that this is stored as a blob in the mysql database and was wondering if anyone has a script that will go through and modify it straight into the database.
Jon
P.S Other than that it's a great program
Changind SNMP community in database
Moderators: Developers, Moderators
I'm not sure if it is saved as a blob. I would do it in this way:
Code: Select all
[root@host]# mysql -D cacti
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 31534 to server version: 3.23.49
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> select * from snmp_hosts;
+----+-----------------+-------------+
| ID | Hostname | Community |
+----+-----------------+-------------+
| 2 | 10.1.1.1 | prevcomm |
+----+-----------------+-------------+
1 row in set (0.00 sec)
mysql> UPDATE snmp_hosts SET Community="newpub" WHERE Hostname="10.1.1.1";
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> select * from snmp_hosts;
+----+-----------------+-----------+
| ID | Hostname | Community |
+----+-----------------+-----------+
| 2 | 10.1.1.1 | newpub |
+----+-----------------+-----------+
1 row in set (0.00 sec)
Who is online
Users browsing this forum: No registered users and 5 guests