How nagios stores data

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
yilmazcan50
Posts: 3
Joined: Tue May 16, 2017 12:48 pm

How nagios stores data

Post by yilmazcan50 »

Hi, we got an assignment about how does the nagios xi stores data collected from monitoring. We couldn't find any good resource about that. If you can give us some resource or lead us to some information that would be great.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: How nagios stores data

Post by dwhitfield »

If you're using XI, log in to mysql with mysql -uroot -pnagiosxi. If you don't know how to look through tables in mysql, you should probably head to the mysql forums.

It's possible some data is in postgres. What version of XI are you using?

If you see a string in the XI UI and want to find where that might be in a text file, grep -R / string is a great way to do that. For a lot of info, the default is going to be /usr/local/nagios/var/nagios.log, but there are plenty of other log files in use.

https://assets.nagios.com/downloads/nag ... ptions.pdf will likely be of use.
yilmazcan50
Posts: 3
Joined: Tue May 16, 2017 12:48 pm

Re: How nagios stores data

Post by yilmazcan50 »

dwhitfield wrote:If you're using XI, log in to mysql with mysql -uroot -pnagiosxi. If you don't know how to look through tables in mysql, you should probably head to the mysql forums.

It's possible some data is in postgres. What version of XI are you using?

If you see a string in the XI UI and want to find where that might be in a text file, grep -R / string is a great way to do that. For a lot of info, the default is going to be /usr/local/nagios/var/nagios.log, but there are plenty of other log files in use.

https://assets.nagios.com/downloads/nag ... ptions.pdf will likely be of use.
Firstly thank you very much for your fast reply and all your help. We really appreciate it.

We also want to ask you about how often does the nagios cleans these data so for huge networks there won't be a constatnly growing huge data? Can we set a custom treshold to clean data regularly or the system sets the treshold by default?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: How nagios stores data

Post by scottwilkerson »

Many of the logs are rotated out within several weeks at most, with the exception of the nagios.log which is archived in /usr/local/nagios/var/archives 1 file per day forever, but you can remove old files, just know that doing so will remove the availability history for those time periods.

There are other settings for amount of time to keep data changable through the UI with sensible defaults, located here
Admin -> System Config -> Performance Settings -> Databases Tab

These can be adjusted to you liking, however realize these are truncation times and if you set the threshold low, it will delete items older than that, for some of the table this will affect how long of a history you have.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
yilmazcan50
Posts: 3
Joined: Tue May 16, 2017 12:48 pm

Re: How nagios stores data

Post by yilmazcan50 »

scottwilkerson wrote:Many of the logs are rotated out within several weeks at most, with the exception of the nagios.log which is archived in /usr/local/nagios/var/archives 1 file per day forever, but you can remove old files, just know that doing so will remove the availability history for those time periods.

There are other settings for amount of time to keep data changable through the UI with sensible defaults, located here
Admin -> System Config -> Performance Settings -> Databases Tab

These can be adjusted to you liking, however realize these are truncation times and if you set the threshold low, it will delete items older than that, for some of the table this will affect how long of a history you have.
Thank you very much for your reply.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: How nagios stores data

Post by dwhitfield »

dwhitfield wrote:What version of XI are you using?
It sounds like you might have all the info you need, but if not, the answer to the above question will be really useful for us.

For example, there was a big change from 5.4.3 to 5.4.4 in /etc/cron.d/nagiosxi and the corresponding logs.
Locked