Hi,
I created a custom report, that reports on the service state, I am using "last month" as my report period. I need to exclude weekends from the report. The report must show the service state for the last month, excluding the SAT & SUN for the last month.
need to exclude weekends from a report
-
benjaminsmith
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: need to exclude weekends from a report
Hi,
Thanks for reaching out to us.
Unfortunately, that is not an option in the reports right now, but I would be happy to get a feature request submitted on this.
The best workaround would be to use the Custom Period option to create multiple reports for the month and exclude those dates.
Regards,
Benjamin
Thanks for reaching out to us.
Unfortunately, that is not an option in the reports right now, but I would be happy to get a feature request submitted on this.
The best workaround would be to use the Custom Period option to create multiple reports for the month and exclude those dates.
Regards,
Benjamin
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
gkrupitsky
- Posts: 7
- Joined: Thu May 09, 2019 3:05 pm
Re: need to exclude weekends from a report
Thanks for the reply, that would work, but than its not auto generated and can't be scheduled.
Surprised there is no script or bash to create a report and schedule via cron
Surprised there is no script or bash to create a report and schedule via cron
-
benjaminsmith
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: need to exclude weekends from a report
Hi,
You can schedule any report by clicking the Schedule This Report icon in the upper right menu. These scheduled reports are saved as a cron job.
It's possible to generate a report from the command line using the API. First, you need to find out how the report is called (what parameters in the URL string) by using the browsers' developer tools. Then you can authenticate using the API and run a curl command on the URL to download the report.
The process is as follows:
Get Auth Token - http://X.X.X.X/nagiosxi/help/auth-token-reference.php
curl -k -L -XPOST 'http://X.X.X.X/nagiosxi/api/v1/authenticate?pretty=1' -d 'username=nagiosadmin&password=mypassword'
Go to the report you want to run under Reports:
- Hit F12 to bring up dev tools
- Click the Network Tab
- Click the Trash icon on top left of dev tools to clear it out (easier to read)
- Click Download and choose whatever type you want (note the type)
- Right-click the request and choose Copy > URL
Use that URL in this:
- Change XXXXXXXXXXX to the token
- Change FILE.type to the filename of the type that is expected
curl -k -L 'FULL_URL_WITH_PARAMS&token=XXXXXXXXXXX' > /tmp/FILE.type
You can schedule any report by clicking the Schedule This Report icon in the upper right menu. These scheduled reports are saved as a cron job.
It's possible to generate a report from the command line using the API. First, you need to find out how the report is called (what parameters in the URL string) by using the browsers' developer tools. Then you can authenticate using the API and run a curl command on the URL to download the report.
The process is as follows:
Get Auth Token - http://X.X.X.X/nagiosxi/help/auth-token-reference.php
curl -k -L -XPOST 'http://X.X.X.X/nagiosxi/api/v1/authenticate?pretty=1' -d 'username=nagiosadmin&password=mypassword'
Go to the report you want to run under Reports:
- Hit F12 to bring up dev tools
- Click the Network Tab
- Click the Trash icon on top left of dev tools to clear it out (easier to read)
- Click Download and choose whatever type you want (note the type)
- Right-click the request and choose Copy > URL
Use that URL in this:
- Change XXXXXXXXXXX to the token
- Change FILE.type to the filename of the type that is expected
curl -k -L 'FULL_URL_WITH_PARAMS&token=XXXXXXXXXXX' > /tmp/FILE.type
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
gkrupitsky
- Posts: 7
- Joined: Thu May 09, 2019 3:05 pm
Re: need to exclude weekends from a report
Thanks benjaminsmith, i will try that.
-
benjaminsmith
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: need to exclude weekends from a report
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!