Code Monkey home page Code Monkey logo

Comments (13)

Kolossi avatar Kolossi commented on July 2, 2024 1

@JasonRivers

I've finally got nagiosgraph working with the docker container after a couple of days head-scratching, but to do it I had to:

  1. Outside the container, edit .\etc\objects\templates.cfg correcting the path of the two entries:
  • action_url /nagios/cgi-bin/show.cgi?host=$HOSTNAME$&service=$SERVICEDESC$' onMouseOver='showGraphPopup(this)' onMouseOut='hideGraphPopup()' rel='/nagios/cgi-bin/showgraph.cgi?host=$HOSTNAME$&service=$SERVICEDESC$&period=day&rrdopts=-w+450+-j
  1. edit .\nagiosgraph\etc\nagiosgraph.conf correcting the three entries:
  • graphcgiurl = /nagios/cgi-bin
  • javascript = /nagios/nagiosgraph/nagiosgraph.js
  • stylesheet = /nagios/nagiosgraph/nagiosgraph.css

The above two not too bad as the files are outside the container, but I also needed

  1. edit /opt/nagios/share/ssi/common-header.ssi. To do this I changed the startup command of the container in my docker-compose so that it runs the following before /usr/local/bin/start_nagios:
  • /bin/sed -i -e "s/src="/nagiosgraph/nagiosgraph.js/src="/nagios/nagiosgraph/nagiosgraph.js/" /opt/nagios/share/ssi/common-header.ssi

I have to do it on each startup, otherwise the change is lost on container teardown/image update.
Having done all of that lot, it now draws graphs on mouseover, loads the nagiosgraph.js without 404ing, and the graph pages work too.

HTH (thanks for your work on the docker container, much appreciated BTW)

from docker-nagios.

masterfuzz avatar masterfuzz commented on July 2, 2024

I think a simple solution to this is to make the owner of those directories nagios rather than root. Makes sense?

from docker-nagios.

cupracer avatar cupracer commented on July 2, 2024

Hi! I just stumbled upon this project and created the pull request #65 to fix the ownership of a mounted /opt/nagios/var.

HTH
Thomas

from docker-nagios.

fregge avatar fregge commented on July 2, 2024

This happened again, because during docker build after building nagiosgraph the sources are deleted. During docker startup you check if nagiosgraph is installed and try to install it otherwise, but the source folder is missing now. Pull request #96 solves that.

from docker-nagios.

wpyung avatar wpyung commented on July 2, 2024

which files need to be copied ? can you give instructions ?

from docker-nagios.

wpyung avatar wpyung commented on July 2, 2024

can you update the docker image so I can use nagiosgraph out of the box ?

from docker-nagios.

wpyung avatar wpyung commented on July 2, 2024

I can't do that as my /opt/nagiosgraph location just contains 2 empty folders: etc and var
How do I populate them and what further steps should I take ?
I am not a docker expert - just a user...

Here is my docker run script

docker run --name nagios4
--hostname rcapp04-nagios
-v /srv/docker/volumes/nagios/opt/etc:/opt/nagios/etc
-v /srv/docker/volumes/nagios/opt/var:/opt/nagios/var
-v /srv/docker/volumes/Custom-Nagios-Plugins:/opt/Custom-Nagios-Plugins
-v /srv/docker/volumes/nagios/opt/nagiosgraph/var:/opt/nagiosgraph/var
-v /srv/docker/volumes/nagios/opt/nagiosgraph/etc:/opt/nagiosgraph/etc
-v /etc/timezone:/etc/timezone:ro
-v /etc/localtime:/etc/localtime:ro
-d --restart unless-stopped
-p 0.0.0.0:8099:80 jasonrivers/nagios:latest

here is what I see from
docker exec -it nagios4 /bin/bash

root@rcapp04-nagios:/# ls /
bin dev home lib64 mnt orig root sbin sys usr
boot etc lib media opt proc run srv tmp var

root@rcapp04-nagios:/# ls /opt
Custom-Nagios-Plugins JR-Nagios-Plugins nagios nagiosgraph
JE-Nagios-Plugins WL-Nagios-Plugins nagios-mssql

root@rcapp04-nagios:/# ls -R /opt/nagiosgraph
/opt/nagiosgraph:
etc var

/opt/nagiosgraph/etc:

/opt/nagiosgraph/var:

from docker-nagios.

Kolossi avatar Kolossi commented on July 2, 2024

@wpyung

Before you start, you need to drop mounting your external versions of /opt/nagiosgraph/etc and ./var, and mount your /srv/docker/volumes/nagios/opt/nagiosgraph somewhere else in the docker filesystem - e.g. /opt/nagiosgraph/mytmp. Then you can copy the docker image versions of ./etc and ./var out to your external filesystem.

Having done that, put the /opt/nagiosgraph/etc and /opt/nagiosgraph/var mounts back in and you should be good. This approach likely also needed for /opt/nagios/etc and /opt/nagios/var dirs too.

from docker-nagios.

wpyung avatar wpyung commented on July 2, 2024

great that did it with no other changes required
/opt/Nagios is OK
Thanks for your help so far...

I see 4 graphs. Yearly and Monthly have data, weekly and daily are blank.
Is there something I have to tweak ?
Or is it just a question of waiting

image

from docker-nagios.

Kolossi avatar Kolossi commented on July 2, 2024

Yay, glad it's working. There is one reading in the daily data (min=max=avg=curr), and you can just see the pixels on the RHS of the graph, so I think it's just a case of waiting.

from docker-nagios.

duckmysick01 avatar duckmysick01 commented on July 2, 2024

Hi, how did you mount back the volumes ? Because it seems like you can't mount volumes in a running container.. Please let me know

from docker-nagios.

wpyung avatar wpyung commented on July 2, 2024

you just need to stop the container to do the mounts and unmounts, then restart it

from docker-nagios.

duckmysick01 avatar duckmysick01 commented on July 2, 2024

thanks

from docker-nagios.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.