Command line to get audit logs from xi_auditlog

This support forum board is for support questions relating to Nagios xi, our flagship commercial network monitoring solution.
xlin125
Posts: 172
Joined: Mon Jan 19, 2015 6:01 pm

Command line to get audit logs from xi_auditlog

Post by xlin125 »

We have Nagios xi 2014R2.7 on RHEL6, and we also have Nagios xi 5.2.3 on RHEL6 and Nagios xi 5.4.8 on RHEL7.

On Nagios xi 2014R2.7, both MySQL and Postgres are used. We can run the command "echo 'select * from xi_auditlog;' | psql nagiosxi nagiosxi" to get the audit logs in the table "xi_auditlog".

On Nagios xi 5.2.3 and Nagios xi 5.4.8, MySQL is used but Postgres is not used. What is the equivalent command that can be used to get the audit logs in the table "xi_auditlog"?
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Command line to get audit logs from xi_auditlog

Post by benjaminsmith »

Hi

The table structre is the same, but connection commands will change from postgress to mysql.

Code: Select all

echo "select * from xi_auditlog;" | mysql -h 127.0.0.1 -uroot -pnagiosxi nagiosxi
Let us know if you need further assistance with the query.

Also, RHEL 6 is EOL and not supported at this time. I would recommend planning a migration for those systems. The Nagios xi license policy does allow for 3 separate activations (production, test and backup) to help make this a smooth transition.

Reference:
Migrating Nagios xi to a different Server

Regards,
Benjamin
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
xlin125
Posts: 172
Joined: Mon Jan 19, 2015 6:01 pm

Re: Command line to get audit logs from xi_auditlog

Post by xlin125 »

@Benjamin, thanks for the quick response.

I tried the command that you provided, and received an access denied error:
$ echo "select * from xi_auditlog;" | mysql -h 127.0.0.1 -uroot -pnagiosxi nagiosxi
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

Any suggestion to resolve this issue?
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Command line to get audit logs from xi_auditlog

Post by benjaminsmith »

Hi,

It looks like the default database passwords were changed on this system. You can retrieve this information by inspecting the following file.

Code: Select all

cat /usr/local/nagiosxi/html/config.inc.php
For more details, we have a useful guide with detailed instructions on changing the default passwords, take a look on page 3 for the database settings.

Nagios xi How to Change Default Passwords

If that's not it, try logging in directly and then running the query.

Code: Select all

mysql -u root -p 
use nagiosxi;
select * from xi_auditlog;
Let us know if you get it resolved.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
xlin125
Posts: 172
Joined: Mon Jan 19, 2015 6:01 pm

Re: Command line to get audit logs from xi_auditlog

Post by xlin125 »

Yes, the default database password was changed during the Nagios xi installation on this system. I found the password, and all looks fine. Thanks!
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Command line to get audit logs from xi_auditlog

Post by benjaminsmith »

Hello @xlin125,

Excellent! We'll go ahead and mark this as resolved.

Have a great weekend.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!