chriscareycode / nagiostv-react

Monitor your Nagios server on a wall mounted TV (or a phone or desktop). Installation instructions are below in the README.md
https://nagiostv.com
GNU General Public License v2.0
67 stars 12 forks source link

Option to hide down host/services with host notifications disabled #26

Closed jessedp closed 3 years ago

jessedp commented 3 years ago

I can not write it short and not awkwardly. The option does this - if a Host that notifications are disabled for is down, don't display it or its services when it goes down.

The impetus behind this is my laptop. If it's on and I can do something about a service, show me. If it's off, I absolutely don't want it displayed.

chriscareycode commented 3 years ago

Hi Jesse, thank you for this contribution. I like the idea to add a new filter option to hide hosts and services with notifications disabled. With that in mind, we should also be adding some sort of indication on the HostItem and ServiceItem that signifies when notifications_enabled === false. We do not currently show that. However I'm not so sure about this implementation to hide hosts and all it's corresponding services if the host has notifications disabled while corresponding services could still be enabled. In this scenario, the host and services would be hidden from the NagiosTV display, but the services could be still sending out notifications. I'm thinking it might be better to have a hideHostNoficationsDisabled and hideServiceNotificationsDisabled options under both hosts and services sections instead of one option that affects both based on the state of the parent host.

chriscareycode commented 3 years ago

I took some of your PR but can't merge this in directly since I made a major refactor on the codebase since the PR was submitted. Essentially this functionality has been added with one major change as I mentioned in the post before. I did not want to have services with notifications enabled be hidden simply because the host they are attached to has notifications disabled. That is a very opinionated use case that may serve your needs, but we do have a lot of people using NagiosTV so it needs to remain more generic in it's function. Each item's notifications_enabled state is unique to itself, host or service, and not controlled by a parent/child relationship. Two options are added to state, hideHostNotificationsDisabled and hideServiceNotificationsDisabled.