Page 1 of 1
Get necessary data v.2
Posted: Thu Jan 30, 2014 3:39 pm
by eFusion
It's me again
I identified that in nagios logs contains data from one day but i need the data for such month for e.g. when we clik on link "View Trends For This Host" in Nagios UI and select period - created a graph with data of the period which we chosen.
I need exactly this data.
Where Nagios save their except in log file? How to get data for the year ir month?
Thanks in advance.
Re: Get necessary data v.2
Posted: Thu Jan 30, 2014 3:51 pm
by tmcdonald
If you know the UNIX timestamp of the range you want, you can do something like the following:
Code: Select all
http://<nagios ip>/nagios/cgi-bin/trends.cgi?t1=1391024861&t2=1391111261&host=localhost&assumeinitialstates=yes&assumestateretention=yes&assumestatesduringnotrunning=yes&includesoftstates=no&initialassumedservicestate=0&initialassumedhoststate=0&backtrack=4&zoom=4
where t1 is the start time and t2 is the end time.
Re: Get necessary data v.2
Posted: Fri Jan 31, 2014 5:03 am
by eFusion
I need to do this with php and run by cron on FreeBSD.
Do you have any ideas where Nagios stores data to output in Trends?
Re: Get necessary data v.2
Posted: Fri Jan 31, 2014 1:26 pm
by sreinhardt
The data for trends are taken from the active and archived log files, and are just processed in a different way from the avail.cgi. When trends is called, it the data is always pulled from these logs and filtered for what nagios needs.
Re: Get necessary data v.2
Posted: Sun Feb 02, 2014 6:15 am
by eFusion
Thanks a lot. Went to try
Re: Get necessary data v.2
Posted: Mon Feb 03, 2014 10:29 am
by tmcdonald
We'll stick around here in case you need help with it.
Re: Get necessary data v.2
Posted: Thu Feb 26, 2015 6:18 am
by eFusion
Can be closed.
Understood.
I use ndoutils for my task.
Thank you all!