Need assistance with adding in passwords for dbmaint

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Post Reply
Psihawk
Posts: 31
Joined: Wed May 13, 2020 9:29 pm

Need assistance with adding in passwords for dbmaint

Post by Psihawk »

I am getting an error when I run the following command

php /usr/local/nagiosxi/cron/dbmaint.php Error is below. How and where do I add the IDs this would need to complete? Can i just add them to a password file or will they need some kind of rights to the database itself?
dnmainterror.png
Cron job file that shows the reference
Cronjob.png
You do not have the required permissions to view the files attached to this post.
gwesterman
Posts: 107
Joined: Wed Aug 23, 2023 11:29 am

Re: Need assistance with adding in passwords for dbmaint

Post by gwesterman »

Hi @Psihawk,

These are defined in /usr/local/nagiosxi/html/config.inc.php. I am not sure why dbmaint.php would not be able to access them, but hopefully this will help you figure it out on your side. Does running the script give you anything other than these two notices?

Please let us know what you find.

Thank you!
Psihawk
Posts: 31
Joined: Wed May 13, 2020 9:29 pm

Re: Need assistance with adding in passwords for dbmaint

Post by Psihawk »

Yes the script fails. Also in the file you mentioned there is no section for DBMaint
Adenied.png
You do not have the required permissions to view the files attached to this post.
sgardil
Posts: 155
Joined: Wed Aug 09, 2023 9:58 am

Re: Need assistance with adding in passwords for dbmaint

Post by sgardil »

Psihawk wrote: Fri May 10, 2024 11:53 am Yes the script fails. Also in the file you mentioned there is no section for DBMaint

Adenied.png
Hey @Psihawk

Could we get a little more information on when this issue started and about your system. For example what distro are you on and what version of XI? Also did this start happening after a certain event? (i.e an upgrade). This post may be a similar issue to yours.
Psihawk
Posts: 31
Joined: Wed May 13, 2020 9:29 pm

Re: Need assistance with adding in passwords for dbmaint

Post by Psihawk »

This occurred right after the latest update we moved to

2024R1.0.1

DBMaintenance hasnt been green since. I looks like we are missing the entries for what is explained here from the other ticket

"In MySQL, there should be an additional user named dbmaint_nagiosxi, and the nagiosxi user should no longer be able to modify/delete records from the xi_auditlog table. In /usr/local/nagiosxi/html/config.inc.php, there should be a db_info entry for nagiosxi with entries for dbmaint_user and dbmaint_pwd."

I am curious of those can be added back in if someone gives the the format of what is needed? Or do I have to run something against the DB to even allow that to work?
gwesterman
Posts: 107
Joined: Wed Aug 23, 2023 11:29 am

Re: Need assistance with adding in passwords for dbmaint

Post by gwesterman »

Hi @Psihawk,

Try the following:

Edit the /usr/local/nagiosxi/html/config.inc.php file and change this section from

Code: Select all

$cfg['db_info'] = array(
    "nagiosxi" => array(
        "dbtype" => 'mysql',
        "dbserver" => '',
        "user" => 'nagiosxi',

to

Code: Select all

$cfg['db_info'] = array(
    "nagiosxi" => array(
        "dbmaint_user" => 'dbmaint_nagiosxi',
        "dbmaint_pwd" => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
        "dbtype" => 'mysql',
        "dbserver" => '',
        "user" => 'nagiosxi',

The xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx is the dbmaintpass= option from the /usr/local/nagiosxi/etc/xi-sys.cfg file

Save the change and restart crond

Code: Select all

systemctl restart crond
Let us know if this works.

Thank you!
Post Reply