need to exclude weekends from a report

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
gkrupitsky
Posts: 7
Joined: Thu May 09, 2019 3:05 pm

need to exclude weekends from a report

Post by gkrupitsky »

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.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: need to exclude weekends from a report

Post by benjaminsmith »

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
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!
gkrupitsky
Posts: 7
Joined: Thu May 09, 2019 3:05 pm

Re: need to exclude weekends from a report

Post by gkrupitsky »

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
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: need to exclude weekends from a report

Post by benjaminsmith »

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
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!
gkrupitsky
Posts: 7
Joined: Thu May 09, 2019 3:05 pm

Re: need to exclude weekends from a report

Post by gkrupitsky »

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

Post by benjaminsmith »

Hi @gkrupitsky,

Sounds good.

We'll keep this open and let me know if you have any questions.
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!
Locked