Page MenuHomePhabricator

Figure out how to make Netbox Reports actionable / alertable
Open, NormalPublic

Description

How do we make them more focused? What mass updates do we need to do to get the database in a state that maximizes green results? We can also consider modifying how reports work to make them more useful.

Event Timeline

crusnov triaged this task as Normal priority.Feb 6 2019, 4:04 AM
crusnov created this task.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 6 2019, 4:04 AM

Investigate running repotrs as a netbox hook.

One idea might be to have a flag on hosts that exempts them from some/all reports (as an additional angle). This produces management overhead however.

A relatively easy idea i've had to implement would be to order the log lines, so that fails would happen first, then warnings, then the info line with the good total. There's no inherent way to do this but for some reports it could be done through an order_by in the query, although many especially if they use custom fields, would have to be done by storing the results in an array, and then iterating it and logging them.

Any insight on upstream plans for reports based on open issues or their mailing list?
Because we can surely go around it for some specific cases like the sort, but if we want to expand the usage of reports those kind of "hacks" will not be enough.

Any insight on upstream plans for reports based on open issues or their mailing list?
Because we can surely go around it for some specific cases like the sort, but if we want to expand the usage of reports those kind of "hacks" will not be enough.

You know what's funny, is I went to check on that bug we filed upstream, and they suggested just the same thing and closed the bug, so really there's no avoiding this method of doing it. Although we could modify the report template to use a javascript table library
or something, or exploit Postgres' JSON object querying.

https://github.com/digitalocean/netbox/issues/2672#issuecomment-448715762

Pretty disappointing to be honest.

yeah, I think they are a bit overwhelmed by the activity on GitHub, all the issues, etc. In the contributing page they state:

Due to an excessive backlog of feature requests, we are not currently accepting any proposals which substantially extend NetBox's functionality beyond its current feature set

So I wouldn't hold my breath for getting something included upstream as they accept only PRs related to "accepted" open issues.
I'd say that for now we can improve it storing them in order, from the most critical to the success ones.

for what it's worth I've figured out the Postgres magic to turn reports into a table, so it'd be relatively easy to do this inside the reports view and allow it to be sorted and stuff.

select results->>0 as stamp, results->>1 as status, results->>2 as device, results->>3 as reference, results->>4 as message from (select json_array_elements((data->'test_ticket'->'log')::json) as results from extras_reportresult) as results;

Change 505657 had a related patch set uploaded (by CRusnov; owner: CRusnov):
[operations/puppet@production] Add a check_netbox_report icinga check

https://gerrit.wikimedia.org/r/505657

Change 505657 merged by CRusnov:
[operations/puppet@production] Add a check_netbox_report icinga check

https://gerrit.wikimedia.org/r/505657