Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed device list down devices that have never been polled #9994

Merged
merged 4 commits into from Mar 19, 2019

Conversation

Projects
None yet
2 participants
@murrant
Copy link
Member

commented Mar 18, 2019

DO NOT DELETE THIS TEXT

Please note

Please read this information carefully. You can run ./scripts/pre-commit.php to check your code before submitting.

Testers

If you would like to test this pull request then please run: ./scripts/github-apply <pr_id>, i.e ./scripts/github-apply 5926
After you are done testing, you can remove the changes with ./scripts/github-remove. If there are schema changes, you can ask on discord how to revert.

@PipoCanaja

This comment has been minimized.

Copy link
Contributor

commented Mar 18, 2019

Oups ... makes sense ... Testing that :|

@PipoCanaja

This comment has been minimized.

Copy link
Contributor

commented Mar 18, 2019

I would suggest this fix instead:

'uptime' => $device->status ? Time::formatInterval($device->uptime, 'short') : ($device->last_polled ? Time::formatInterval($device->last_polled->diffInSeconds(), 'short') : ' Never'),

@PipoCanaja

This comment has been minimized.

Copy link
Contributor

commented Mar 18, 2019

Longer, but the display is better in case last_polled is empty. Tested OK after emptying last_polled in the db.

@@ -126,7 +126,7 @@ public function formatItem($device)
'metrics' => $this->getMetrics($device),
'hardware' => Rewrite::ciscoHardware($device),
'os' => $this->getOsText($device),
'uptime' => Time::formatInterval($device->status ? $device->uptime : ($device->last_polled ? $device->last_polled->diffInSeconds() : null), 'short'),
'uptime' => $device->status ? Time::formatInterval($device->uptime, 'short') : ($device->last_polled ? Time::formatInterval($device->last_polled->diffInSeconds(), 'short') : 'Never'),

This comment has been minimized.

Copy link
@murrant

murrant Mar 19, 2019

Author Member

Uptime: Never seems unclear. Perhaps Never Polled

murrant added some commits Mar 19, 2019

@murrant murrant removed the Alerting 🔔 label Mar 19, 2019

@PipoCanaja
Copy link
Contributor

left a comment

LGTM

@murrant murrant merged commit bc24d39 into librenms:master Mar 19, 2019

6 checks passed

Inspection Summary
Details
Node: analysis
Details
Travis CI - Pull Request Build Passed
Details
WIP Ready for review
Details
codeclimate All good!
Details
license/cla Contributor License Agreement is signed.
Details

@murrant murrant deleted the murrant:devices-downtime-fix branch Mar 19, 2019

@laf laf changed the title Fix device list down devices that have never been polled Fixed device list down devices that have never been polled Mar 31, 2019

funzoneq added a commit to funzoneq/librenms that referenced this pull request Apr 30, 2019

Fix device list down devices that have never been polled (librenms#9994)
* Fix device list down devices that have never been polled

* Suggestion with 'Never' in case last_polled empty and down

* Improve handling of all cases

* fix doc comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.