Migrating Cacti Database
Moderators: Developers, Moderators
Migrating Cacti Database
Hi,
I am working on migrating cacti from Linux RedHat Server to Linux RedHat 7 Server.
I am using this article to do the migration and am having issues with the restore process of the database.
I did a sqldump on old server and populated the new database (on rhel7).
However when i run the command to see my database tables i dont see any enteries as i do on old server when i run the same command.
Any thoughts?
Thanks,
I am working on migrating cacti from Linux RedHat Server to Linux RedHat 7 Server.
I am using this article to do the migration and am having issues with the restore process of the database.
I did a sqldump on old server and populated the new database (on rhel7).
However when i run the command to see my database tables i dont see any enteries as i do on old server when i run the same command.
Any thoughts?
Thanks,
Re: Migrating Cacti Database
mysql –p
> CREATE DATABASE cacti;
mysql –u cacti –p cacti < cacti_db_backup_filename.sql
mysql –p
> GRANT ALL PRIVILEGES ON cacti.* TO cacti@localhost IDENTIFIED BY “yourdbuserpassword”;
> FLUSH PRIVILEGES;
> CREATE DATABASE cacti;
mysql –u cacti –p cacti < cacti_db_backup_filename.sql
mysql –p
> GRANT ALL PRIVILEGES ON cacti.* TO cacti@localhost IDENTIFIED BY “yourdbuserpassword”;
> FLUSH PRIVILEGES;
Re: Migrating Cacti Database
Perfect that worked smiles, thanks
now i can see my database entries from old server and i can see the devices listed on the webpage for cacti.
they arent creating any graphs though, might be permissions issue or do i have to re import the rrd files?
before i readded the database as smiles instructed i did migrate the rrd files from old server by exporting them as xml and then re-importing to new server.
Thanks,
now i can see my database entries from old server and i can see the devices listed on the webpage for cacti.
they arent creating any graphs though, might be permissions issue or do i have to re import the rrd files?
before i readded the database as smiles instructed i did migrate the rrd files from old server by exporting them as xml and then re-importing to new server.
Code: Select all
Step 4.1: Old Server
- On the old server, convert RRD files into XML files as follows.
- Create a directory to store the XML files.
# mkdir /tmp/xml
# cd /var/lib/cacti/rra
- Convert the RRD files to XML files.
# for i in `find -name "*.rrd"`; do rrdtool dump $i > /tmp/xml/$i.xml; done
- Create a tar file.
# cd /tmp/xml
# tar cvfz cacti.tar.gz *
- Copy the tar file to the new server.
# scp cacti.tar.gz root@NewServerIP:/root
Step 4.2: New Server
- On the new server, we will copy the tar file to the right directory and extract the contents. After extraction, we will restore the RRD files from the XML ones.
- Copy and extract the files to the right directory.
# cp /root/cacti.tar.gz /var/lib/cacti/rra
# cd /var/lib/cacti/rra
# tar zxvf cacti.tar.gz
- Restore the RRD files from the XML files.
# for i in `find -name "*.xml"`; do rrdtool restore $i `echo $i |sed s/.xml//g`; done
- phalek
- Developer
- Posts: 2838
- Joined: Thu Jan 31, 2008 6:39 am
- Location: Kressbronn, Germany
- Contact:
Re: Migrating Cacti Database
Yes it can be a permission, or your cronjob entry doesn't exist yet ... ?
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
Re: Migrating Cacti Database
i have the cron file (/etc/cron.d/cacti configured as
And it has root permission, also rrd files have root permission.
also where can i confirm what rra location i should be using, there are couple locations which have that folder.
thanks
Code: Select all
*/5 * * * * cacti /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1
also where can i confirm what rra location i should be using, there are couple locations which have that folder.
thanks
Re: Migrating Cacti Database
Show us the permissions on the RRD files.
You say they have root permission (meaning owned by root I assume) but you are setting the poller to run as "cacti". Does the Cacti user actually exist? Does the webserver at least have access to read the rrd files?
You say they have root permission (meaning owned by root I assume) but you are setting the poller to run as "cacti". Does the Cacti user actually exist? Does the webserver at least have access to read the rrd files?
Re: Migrating Cacti Database
Hi,
Here are the permissions on few of the rrd files (which are located in /usr/share/cacti/rra/
and yes the cacti user does exist in the system,
how/where can i check if webserver has access to read the rrd files?
Thanks,
Here are the permissions on few of the rrd files (which are located in /usr/share/cacti/rra/
Code: Select all
-rwxr-xr-x 1 root root 47992 Nov 23 15:07 /usr/share/cacti/rra/sv-baydevweb-04_baynet_local_cpu_1315.rrd
-rwxr-xr-x 1 root root 47992 Nov 23 15:07 /usr/share/cacti/rra/sv-baydevweb-04_baynet_local_cpu_1368.rrd
-rwxr-xr-x 1 root root 94816 Nov 23 15:07 /usr/share/cacti/rra/sv-baydevweb-04_baynet_local_hdd_used_1311.rrd
Code: Select all
[root@svprodmon01 ~]# cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
nagios:x:1001:1001::/home/nagios:/bin/bash
apache:x:48:48:Apache:/usr/share/httpd:/sbin/nologin
mysql:x:27:27:MariaDB Server:/var/lib/mysql:/sbin/nologin
cacti:x:986:981::/usr/share/cacti:/sbin/nologin
Thanks,
Re: Migrating Cacti Database
im seeing these errors in cacti.log
11/30/2016 06:41:24 PM - CMDPHP: Poller[0] WARNING: SNMP Get Timeout for Host:'sv-baydevweb-04.baynet.local', and OID:'.1.3.6.1.2.1.1.3.0'
does this look like a permission thing?
11/30/2016 06:41:24 PM - CMDPHP: Poller[0] WARNING: SNMP Get Timeout for Host:'sv-baydevweb-04.baynet.local', and OID:'.1.3.6.1.2.1.1.3.0'
does this look like a permission thing?
- phalek
- Developer
- Posts: 2838
- Joined: Thu Jan 31, 2008 6:39 am
- Location: Kressbronn, Germany
- Contact:
Re: Migrating Cacti Database
your permissions are wrong. Execute the following:
Code: Select all
chown cacti.apache /usr/share/cacti/rra
chown cacti.apache /usr/share/cacti/rra/*.rrd
chmod 664 /usr/share/cacti/rra/*.rrd
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
Re: Migrating Cacti Database
i have made the permission changes but i am still seeing these kinda errors in log for all servers,
but when i run the snmpwalk command manually from command it passes
[/code]
[root@svprodmon01 ~]# snmpwalk -v 1 -c public sv-baydevweb-04.baynet.local .1.3.6.1.2.1.1.3.0
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (127279117) 14 days, 17:33:11.17
[/code]
i also wanna show the settings page, maybe something looks wrong there? (added as a pics)
Code: Select all
12/01/2016 08:01:02 PM - CMDPHP: Poller[0] Host[89] DS[928] WARNING: Result from CMD not valid. Partial Result: U
12/01/2016 08:01:02 PM - CMDPHP: Poller[0] Host[89] DS[929] WARNING: Result from CMD not valid. Partial Result: U
12/01/2016 08:01:04 PM - CMDPHP: Poller[0] WARNING: SNMP Get Timeout for Host:'sv-baydevsql-04.baynet.local', and OID:'.1.3.6.1.2.1.1.3.0'"
[/code]
[root@svprodmon01 ~]# snmpwalk -v 1 -c public sv-baydevweb-04.baynet.local .1.3.6.1.2.1.1.3.0
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (127279117) 14 days, 17:33:11.17
[/code]
i also wanna show the settings page, maybe something looks wrong there? (added as a pics)
- Attachments
-
- CACTI2.png (70.19 KiB) Viewed 1655 times
-
- CACTI1.png (60.74 KiB) Viewed 1655 times
- phalek
- Developer
- Posts: 2838
- Joined: Thu Jan 31, 2008 6:39 am
- Location: Kressbronn, Germany
- Contact:
Re: Migrating Cacti Database
These are not permission errors. They only show that Cacti wasn't able to retrieve data from the device, either because it is unreachable (timeout) or it simply didn't retrun any data ( Partial Result: U )
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
Re: Migrating Cacti Database
Thanks Phalek,
Do you know where i can go from here to troubleshoot why cacti isn't able to retrieve data from device?
thanks
Do you know where i can go from here to troubleshoot why cacti isn't able to retrieve data from device?
thanks
Who is online
Users browsing this forum: No registered users and 3 guests