Exporting 400+ users from CactiEZ v0.8.8a to Cacti v1.1.28

If you figure out how to do something interesting/cool in Cacti and want to share it with the community, please post your experience here.

Moderators: Moderators, Developers

Post Reply
Author
Message
coolcliff
Posts: 14
Joined: Wed Dec 20, 2017 3:51 am

Exporting 400+ users from CactiEZ v0.8.8a to Cacti v1.1.28

#1 Post by coolcliff » Thu Dec 21, 2017 6:21 am

Hi

i need help exporting about 400 + users from a cacti system (CactiEZ with Version 0.8.8a) to another cacti system (Version 1.1.28)

creating every user manually and also communicating the new passwords to users will be quite a task,
can some suggest how i can go about achieving this?

Regards

Clifford Dsouza

netniV
Cacti Guru User
Posts: 2682
Joined: Sun Aug 27, 2017 12:05 am

Re: Exporting 400+ users from CactiEZ v0.8.8a to Cacti v1.1.

#2 Post by netniV » Thu Dec 21, 2017 7:15 am

You can use the cli to add users I believe by copying a template.

Code: Select all

cd <cacti>/cli
php copy_user.php <template user> <new user>
Once you have done that for each user in question. You can then update their password using a combination of PHP and MySQL.

You can generate a password using the following for PHP 5.5 or above:

Code: Select all

echo "New password hash: " . password_hash('<password>',PASSWORD_DEFAULT);
Or using the following for older versions:

Code: Select all

echo "New password hash: " .md5('<password>');
With a password hash, you then update the user_auth table via MySQL's cli using the following SQL statement:

Code: Select all

UPDATE `user_auth` SET password = '<hash>' where username = '<username>';
You could even update the "New password hash" output to include the SQL so it's just a copy and paste job.

coolcliff
Posts: 14
Joined: Wed Dec 20, 2017 3:51 am

Re: Exporting 400+ users from CactiEZ v0.8.8a to Cacti v1.1.

#3 Post by coolcliff » Tue Dec 26, 2017 1:42 am

Thank you netniV

Post Reply