Hi all,
I have two questions:
1:
I set the log-rotation-method to daily in nagios 3.5.1 and also manually set a different directory (than the default one) to store them.
For some reason nagios isn't rotating the log daily (also not hourly, if I set it to "h"). And also it's not using the directory, I set.
Is this a known problem?
2:
I use the availability-reporting in the following way:
There are two services (in one servicegroup) on 5 nodes and out of this I let nagios calculate the report weekly by the servicegroup.
Where does nagios get it's information for this report from?
On a different server (where I don't have the log-rotation-problem), nagios rotates the files every day at midnight. But during this, nagios just saves the current state of the hosts and their respective checks.
So nagios must use another log-file for this, as this wouldn't be a sufficient statement about the availability, if it's just using the midnight-state (even when the host was down for e.g. 9h on 2 days in the week). Or would nagios write this information to that file?
Thanks all for you help!
BR
Log-rotation and availability-report
Re: Log-rotation and availability-report
Short update:
I could resolve problem one by changing the ownership of the folder, the logrotation should write to.
I could resolve problem one by changing the ownership of the folder, the logrotation should write to.
Re: Log-rotation and availability-report
Since you resolved this before we could post, is there anything else you would like help with in this thread, or should I close it?
Former Nagios Employee.
me.
me.
Re: Log-rotation and availability-report
My second question/problem still needs to be answered:
I hope someone can help me with this?2:
I use the availability-reporting in the following way:
There are two services (in one servicegroup) on 5 nodes and out of this I let nagios calculate the report weekly by the servicegroup.
Where does nagios get it's information for this report from?
On a different server (where I don't have the log-rotation-problem), nagios rotates the files every day at midnight. But during this, nagios just saves the current state of the hosts and their respective checks.
So nagios must use another log-file for this, as this wouldn't be a sufficient statement about the availability, if it's just using the midnight-state (even when the host was down for e.g. 9h on 2 days in the week). Or would nagios write this information to that file?
Re: Log-rotation and availability-report
The Availability report does use the nagios.log file and the archives to generate the report.
When you run the report with "Assume Initial States" as yes, if Nagios does not know the initial state of host when the period begins, it will use the object initial state. Otherwise I presume it will be treated as "Unknown"
When you run the report with "Assume Initial States" as yes, if Nagios does not know the initial state of host when the period begins, it will use the object initial state. Otherwise I presume it will be treated as "Unknown"
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Log-rotation and availability-report
Sorry, but I'm a bit confused about this sentence:
In this case, this would mean, that these reports are just a nice looking feature, which don't say anything at all (and is getting even worse if you let the log rotate e.g. daily and create monthly reports)???
Do you mean, if I e.g. let the log rotate every hour, it's just using the states which are known at the moment of the log-rotation and assumes that at any other time the host or the services were fully available?When you run the report with "Assume Initial States" as yes, if Nagios does not know the initial state of host when the period begins, it will use the object initial state.
In this case, this would mean, that these reports are just a nice looking feature, which don't say anything at all (and is getting even worse if you let the log rotate e.g. daily and create monthly reports)???
Re: Log-rotation and availability-report
The report should look at the data from the rotation at midnight (Current State) at the start of the report and go forward to calculate the Availability if the data is in the logs.
If you set the Assume Initial State to No, and the Nagios system doesn't know the state, it will be shown as unknown.
If you set the Assume Initial State to No, and the Nagios system doesn't know the state, it will be shown as unknown.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Log-rotation and availability-report
Sorry for asking again but let me give you an example:
I do hourly rotation of the logs (all the time to the full hour).
One of my server breaks down on the 16.02.2016 at 15:12 and I can fix it by 15:49 and all checks are "OK" again.
So I have the state of 15:00 and 16:00 and in no rotated log this will show up then, right?
If I now go ahaead and create availability reports, this impact/short outage will not be included in the calculation, if I set the "Assume Initial States" to "Yes" and the "First Assumed Host State" to "Host Up" and the "First Assumed Service State" to Serverice Ok", right?
Please correct me if I'm wrong and thanks for the help!
I do hourly rotation of the logs (all the time to the full hour).
One of my server breaks down on the 16.02.2016 at 15:12 and I can fix it by 15:49 and all checks are "OK" again.
So I have the state of 15:00 and 16:00 and in no rotated log this will show up then, right?
If I now go ahaead and create availability reports, this impact/short outage will not be included in the calculation, if I set the "Assume Initial States" to "Yes" and the "First Assumed Host State" to "Host Up" and the "First Assumed Service State" to Serverice Ok", right?
Please correct me if I'm wrong and thanks for the help!
Re: Log-rotation and availability-report
From some testing that I just did, it looks like the report is going to look at everything in the archives directory, not just the current log. Does that indirectly answer your question, or would you like us to investigate further? This was tested on 4.1.1.
Former Nagios Employee.
me.
me.
Re: Log-rotation and availability-report
Unfortunately no, this doesn't answer my question.
I don't think, that it makes a big difference, if I'm using 3.5.1 (from EPEL-repo).
Just to precise my question:
I know, that the availability-reporting-tool is looking into all files.
My question was more likely, if nagios can include the alerts/outages/problems between two log-rotations (assuming we do hourly log-rotation) into the calculation of the availability.
This question arises, because I noticed that nagios only saves the "current state" of hosts/services at that particular point in time where the rotation happens and "throws away the rest of the last hour/since the last rotation".
If this is the case, nagios only has 24 states per day (assuming we still do hourly rotation) to calculate the availability.
And assuming we switch to daily log-rotation, we would only have 1 state per day and could not include an 3h outage, which started e.g. at 9am.
I hope this explains my problem a bit better.
Thanks a lot for trying to help me!
I don't think, that it makes a big difference, if I'm using 3.5.1 (from EPEL-repo).
Just to precise my question:
I know, that the availability-reporting-tool is looking into all files.
My question was more likely, if nagios can include the alerts/outages/problems between two log-rotations (assuming we do hourly log-rotation) into the calculation of the availability.
This question arises, because I noticed that nagios only saves the "current state" of hosts/services at that particular point in time where the rotation happens and "throws away the rest of the last hour/since the last rotation".
If this is the case, nagios only has 24 states per day (assuming we still do hourly rotation) to calculate the availability.
And assuming we switch to daily log-rotation, we would only have 1 state per day and could not include an 3h outage, which started e.g. at 9am.
I hope this explains my problem a bit better.
Thanks a lot for trying to help me!