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

Allow alternative URLs for Hosts/Services #3

Open
garnser opened this issue Sep 10, 2020 · 7 comments
Open

Allow alternative URLs for Hosts/Services #3

garnser opened this issue Sep 10, 2020 · 7 comments

Comments

@garnser
Copy link

garnser commented Sep 10, 2020

Not all nagios-based monitoring systems which has livestatus available is utilizing the hardcoded URL to get access to the object. Please consider adding a configurable "status.cgi?host= addresses" and likewise for services.

As a sample, I'm using Check_MK which renders the URLs as follows:

Hosts:
https://monitoringhost/site/check_mk/index.py?start_url=view.py%3Ffilled_in%3Dfilter%26host%3D**hostname**%26view_name%3Dhost

Services:
https://monitoringhost/site/check_mk/index.py?start_url=view.py%3Fhost%3D**hostname**%26service%3D**service**%26view_name%3Dservice

@roganartu
Copy link

Thanks for the feedback!

The URLs are rendered here, where the hardcoded path you describe can be found: https://github.com/hudson-trading/netbox-nagios/blob/main/netbox_nagios/templates/device_nagios_box.html. I don't see any reason the path and query params wouldn't be able to be configurable.

We would accept a PR if you'd like to submit one.

@nikor30
Copy link

nikor30 commented Jan 27, 2021

Hi we are also using check_MK think it´s very popular regarding network monitoring.
Also I have here the same issue , bleo the link of the device how it´s in checkmk

http://checkmk/sdestovpcmk1/check_mk/index.py?start_url=%2Fsdestovpcmk1%2Fcheck_mk%2Fview.py%3Ffilled_in%3Dfilter%26host%3DSSTO153CIS%26view_name%3Dhost

and here when I click on the go to nagios btton in netbox

http://chekmk/nagios/cgi-bin/status.cgi?host=SSTO153CIS

I sit possible you can help us here ?

@skalec
Copy link

skalec commented Sep 27, 2021

I would like to join the topic. For example, we use icinga2 and would also like to use this plugin here. So a customizable link would be usable for several different monitoring tools.

@nikor30
Copy link

nikor30 commented Feb 21, 2022

Hi, so can you add this feature for more broader integration for this plugin

@skalec
Copy link

skalec commented Mar 7, 2022

Any Reply from the admin?

@fabi125
Copy link
Collaborator

fabi125 commented Mar 7, 2022

I'm fairly busy with other things right now, not sure when I can get around adding this feature. But I'll be more than happy to review a PR if anybody else wants to contribute.

@skalec
Copy link

skalec commented Mar 7, 2022

Hello. I just tried to change the plugin a bit. I was successful. I made the following adjustments to call up the live status of icinga2.

device_nagios_buttons.html

change
<a href="{{ nagios_base_url }}status.cgi?host={{ object.name }}" class="btn btn-sm btn-info" target="_blank"> <span class="mdi mdi-open-in-new" aria-hidden="true"><span> Open in Nagios </a>

to

<a href="{{ nagios_base_url }}monitoring/host/show?host={{ object.name }}" class="btn btn-sm btn-info" ta> <span class="mdi mdi-open-in-new" aria-hidden="true"><span> Open in Icinga2 </a>

device_nagios_box.html

change

<a href='{{ nagios_base_url }}status.cgi?host={{ object.name }}' target="_blank">

to

<a href='{{ nagios_base_url }}monitoring/host/show?host={{ object.name }}' target="_blank">

change
<a href='{{ nagios_base_url }}extinfo.cgi?type=2&host={{ object.name }}&service={{ service.0 }}' target="_blank">{{ service.0 }}</a>

to

<a href='{{ nagios_base_url }}monitoring/service/show?host={{ object.name }}&service={{ service.0 }}' target="_blank">{{ service.0 }}</a>

confoguration.py

PLUGINS_CONFIG = { "netbox_nagios": { "livestatus_host": "monitoring.example.com", "nagios_base_url": "https://monitoring.example.com/icingaweb2/", }, }

I tried using the livestatus_port option. unfortunately this didn't work. So I redirected the default port 6557 to port 6666 from Icinga2.

I hope it helps you further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants