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

Nagiosgraph not accessible if using proxy #63

Closed
cathode911 opened this issue Apr 16, 2018 · 2 comments
Closed

Nagiosgraph not accessible if using proxy #63

cathode911 opened this issue Apr 16, 2018 · 2 comments

Comments

@cathode911
Copy link

Hey, thanks for the awesome container! It's working great, although i found a minor issue with nagiosgraph.

I run nagios container through nginx proxy with url https://mysrv.domain.com/nagios4/ and although nagios works fine with proxy - nagiosgraph shows 404 as its urls are https://mysrv.domain.com/cgi-bin.....
I guess they are static.

@JasonRivers
Copy link
Owner

Sorry for the delay, This is configurable in your Nagios config.
I use a template for services I wish to graph, this looks like the following:

define service {
        name                            graphed-service
        action_url                      /cgi-bin/show.cgi?host=$HOSTNAME$&service=$SERVICEDESC$' onMouseOver='showGraphPopup(this)' onMouseOut='hideGraphPopup()' rel='/cgi-bin/showgraph.cgi?host=$HOSTNAME$&service=$SERVICEDESC$&period=day&rrdopts=-w+450+-j
        register                        0
}

and then my service template does the following:

define service {
        name                            ICMPv4-Template
        use                             service-global,graphed-service
        service_description             ICMPv4
        check_command                   check_ping!-4 -H $HOSTADDRESS$ -w 80.0,10% -c 100.0,20%
        check_interval                  1
        register                        0
}

On the graphed-service, you can change the URL to be anything you want, you could even use grafana or similar if you wanted.

Hopefully this fixes the issue, Alternatively in your proxy under NGINX you could forward /cgi-bin to /nagios4/cgi-bin, something like:

location /cgi-bin/ {
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_pass http://nagioscontainer/cgi-bin;
}

Let me know how you get on.

@cathode911
Copy link
Author

cathode911 commented Aug 31, 2018

Jason, I have tested your approach and it works like a charm!
Thank you for you help and for the great container, saves me loads of time ;)

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

2 participants