Hi,
is there an automated method to export the audit log csv from the command line? (eg. cronjob)
We need to load it periodically to another application.
I tried using wget and cookies but always endet up with "Your session has timed out." so I guess my authentification is done wrong.
Kind regards,
Gerhard
Nagios XI / Audit Log / CSV-Export
Re: Nagios XI / Audit Log / CSV-Export
You could try this one-liner:
Seems to work for me. Bear in mind that on some systems the file might actually not go into /tmp, but rather /tmp/systemd-private-<long hash>-mariadb.service-<random>/tmp/audit_log.csv
Code: Select all
echo "use nagiosxi; select * into outfile '/tmp/audit_log.csv' fields terminated by ',' enclosed by '\"' lines terminated by '\n' from xi_auditlog" | mysql -u root -pnagiosxiFormer Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
Re: Nagios XI / Audit Log / CSV-Export
Thanks, that would work - but unfortunately we are still on a 2014-version so that probably explains why I didnt see it myself in the database 
Any idea how this could be resolved on 2014R2.7 ?
Upgrade is already planned, but will take place later this year.
Any idea how this could be resolved on 2014R2.7 ?
Upgrade is already planned, but will take place later this year.
Re: Nagios XI / Audit Log / CSV-Export
If you're using postgres for the database, try:
Code: Select all
echo "\copy xi_auditlog to '/tmp/audit_log.csv' csv header" | psql -d nagiosxi -U nagiosxi -wFormer Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
Re: Nagios XI / Audit Log / CSV-Export
Thanks again!
That will work till we upgrade
That will work till we upgrade
Re: Nagios XI / Audit Log / CSV-Export
Sure thing! Is it alright if I lock this thread and mark the issue as resolved?
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
Re: Nagios XI / Audit Log / CSV-Export
Yes, of course.