nagios csv question
Re: nagios csv question
Can you provide a bit more clarification on what you're looking for in regards to the time? Where are you looking for this 'time' at?
Former Nagios Employee
-
- Posts: 49
- Joined: Thu Feb 14, 2013 9:32 am
Re: nagios csv question
Hi @rkennedy
The script extracts information as below (I did minor changes to it):
TIME_UP_UNSCHEDULED
2678400
So you have to split the given number by 60, then by 60 again (just as timeticks results from SNMP queries)
2678400/60/60 = 744 minutes (31 days X 24h per day)
So, I would like to know if is it possible to get results as shown by Nagios availabily report, example: 6d 23h 59m 26s
Thanks!
The script extracts information as below (I did minor changes to it):
Code: Select all
REQUEST_METHOD="GET" REMOTE_USER="nagiosadmin" QUERY_STRING="show_log_entries=&host=all&timeperiod=lastmonth&reportperiod=workhours&assumeinitialstates=yes&assumestateretention=yes&assumestatesduringnotrunning=yes&includesoftstates=no&initialassumedhoststate=0&initialassumedservicestate=0&backtrack=4&csvoutput=" /usr/local/nagios/sbin/avail.cgi > extract.csv
2678400
So you have to split the given number by 60, then by 60 again (just as timeticks results from SNMP queries)
2678400/60/60 = 744 minutes (31 days X 24h per day)
So, I would like to know if is it possible to get results as shown by Nagios availabily report, example: 6d 23h 59m 26s
Thanks!
Re: nagios csv question
This isn't built in to Core, you will need to parse this out in a script or use Excel to make the changes.
Former Nagios employee
-
- Posts: 49
- Joined: Thu Feb 14, 2013 9:32 am
Re: nagios csv question
Are all of your questions regarding this answered?
Former Nagios Employee.
me.
me.
Re: nagios csv question
I have the question. Why export to CSV is available only for *ALL SERVICES* and *ALL HOSTS*? What about SERVICEGROUPS and HOSTGROUPS?
I've found the Patch (https://support.nagios.com/forum/viewto ... 25&p=70886), but the message is trunkated
I've found the Patch (https://support.nagios.com/forum/viewto ... 25&p=70886), but the message is trunkated
Re: nagios csv question
That patch almost certainly would not work against a modern version of Core, since that is from 2005.
The simple answer is just that it hasn't been added yet. Maybe nobody officially requested it be added? You can file a feature request here:
https://github.com/NagiosEnterprises/nagioscore/issues
Otherwise if you do not have a GitHub account I can file it on your behalf.
The simple answer is just that it hasn't been added yet. Maybe nobody officially requested it be added? You can file a feature request here:
https://github.com/NagiosEnterprises/nagioscore/issues
Otherwise if you do not have a GitHub account I can file it on your behalf.
Former Nagios employee
Re: nagios csv question
Clearly.
Feature request it's long. Easier way is to parse html.
Just Grab needed service-group report and parse it:
Feature request it's long. Easier way is to parse html.
Just Grab needed service-group report and parse it:
Code: Select all
/nagios/cgi-bin/avail.cgi?show_log_entries=&servicegroup=my-service-group&timeperiod=last7days&smon=9&sday=1&syear=2016&shour=0&smin=0&ssec=0&emon=9&eday=16&eyear=2016&ehour=24&emin=0&esec=0&rpttimeperiod=&assumeinitialstates=yes&assumestateretention=yes&assumestatesduringnotrunning=yes&includesoftstates=yes&initialassumedhoststate=0&initialassumedservicestate=0&backtrack=0&csvoutput=
Re: nagios csv question
I can still file the request so it's built-in at some point, but if that works for now do you mind if we close this thread?
Former Nagios employee
Re: nagios csv question
Lets make the request (export to csv for given hostgroup/servicegroup and All hostgroups/servicegroups) and close the thread.
Thank you.
Thank you.