-
Notifications
You must be signed in to change notification settings - Fork 255
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 working #67
Comments
Or maybe, what are the good rights to apply to the directories? |
Hello, Same issue here:
I've tried with latest, 4.4.0 and 4.3.2. Maybe I have missed something ? Let me know, |
Yeaa there is some issue with perl path like /usr/local/lib/x86_64-linux-gnu/perl/5.22.1 ...etc. The workaround is to reinstall NagiosGraph. Here is how you can do that: Start your container with volumes #Clean /opt/nagiosgraph folder --- you will receive ...etc and ... var are busy dont worry. #Build your NagiosGraph --- you dont need to download it its already there just reinstall it. No errors anymore. |
I'd like to get more info on this, I am not seeing these errors at all. |
Which log are you seeing these errors in? --- Docker logs ... docker logs -f nagios4 That issues is only when you specify volumes for nagiosgraph (options below). If you dont use them its fine. If you run it without volumes if fine. As I said I didn't deep dive what is the problem I just reinstall it and now its fine. #Docker log pastebin |
Thanks, OK so this looks like the nagiosgraph install is putting files in etc, so when externally mounted those files are no longer in-place. I understand the issue, I'll take a look and see if I can get the install of nagiosgraph to be a little more sensible with where it's putting files it requires. |
You can mount share over any folder and the filesystem will use latest mount. If you unmount the volume you will start seeing files from first mount ,so solution is to: |
Yep, That is one option to copy files after the container starts (I do this with example configs if there is no configs found), The alternative will be to have those files elsewhere anyway, I am looking at both options right now. |
If /opt/nagiosgraph/etc is externally mounted this will re-install the files required. see #67 for more details
@vhristev once dockerhub has built the latest commit, this should fix this issue, If the required file is not in /opt/nagiosgraph/etc then it will re-run the installation, in my tests, it is renaming the existing config files with a date if they exist. This will only run if ngshared.pm is not in the directory. |
Hello, Got this issue with the new image: Reinstall of nagiosgraph shows this error: my running command is, as root: Best regards |
That is permissions related. When you create your volume folders you must be sure your docker user can write in those folders. So if you create it with 'root' account change owner to your docker user. I dont know with which user your docker is running so check it out with "ps aux | grep docker" If you want more info about that check that post: https://denibertovic.com/posts/handling-permissions-with-docker-volumes/ |
Thanks for your quick reply,
Docker is running as root too. Directories created by docker run belongs to
root too. Volumes are created when running docker run command.
Best regards
2018-07-05 15:48 GMT+02:00 Valentin Hristev <[email protected]>:
… That is permissions related.
When you create your volume folders you must be sure your docker user can
write in those folders. So if you create it with 'root' account change
owner to your docker user. I dont know with which user your docker is
running so check it out with "ps aux | grep docker"
If you want more info about that check that post:
https://denibertovic.com/posts/handling-permissions-with-docker-volumes/
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#67 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ARDT5l_T0dZFTclkz3OclefBD9RMZLBbks5uDhk2gaJpZM4UKoph>
.
|
Im not sure what you exactly doing but you can see its permissions issue in the log. Volumes are share points if you don't create the folders below and give them correct permissions its not going to work. Folders below must exist with correct permission. When you start docker with -v its not creating the folders for you: Create foldersmkdir /root/docker-nagios/etc /root/docker-nagios/var /root/docker-nagios/Custom-Nagios-Plugins /root/docker-nagios/nagiosgraph/var /root/docker-nagios/nagiosgraph/etc Just for the test give 777 permissions.chmod -R 777 /root/docker-nagios/etc /root/docker-nagios/var /root/docker-nagios/Custom-Nagios-Plugins /root/docker-nagios/nagiosgraph/var /root/docker-nagios/nagiosgraph/etc |
Take ownership of /opt/nagios and /opt/nagiosgraph for issue #67 when thethe directory does not exist before starting the image.
@nicocolt latest commit should take ownership of the directories when Nagios starts. |
Hello,
With the latest image, and chmod 777, it works. Without chmod it does not
work. I don't think so chmod to 777 is a good idea though.
Any ideas?
Best regards
2018-07-05 16:33 GMT+02:00 Jason Rivers <[email protected]>:
… @nicocolt <https://github.com/nicocolt> latest commit should take
ownership of the directories when Nagios starts.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#67 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ARDT5unsUyhKRRFNd_qmzqpZ419Y02aEks5uDiPXgaJpZM4UKoph>
.
|
JasonRivers last post is that he fix permissions ,so pull the latest code and try again. As I said its a matter of user ownership ,so when you run the image you can see which user ID is creating files and chown to that ID |
I have pulled the latest image from 41 minutes ago. Where I can find the
UID, by ls -l on the docker-nagios directory i think ?
Best regards
2018-07-05 17:32 GMT+02:00 Valentin Hristev <[email protected]>:
… JasonRivers last post is that he fix permissions ,so pull the latest code
and try again.
As I said its a matter of user ownership ,so when you run the image you
can see which user ID is creating files and chown to that ID
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#67 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ARDT5ufBfRbun-nGGFteGf-pHcr7AwZWks5uDjF7gaJpZM4UKoph>
.
|
Hello,
It works. With chmod 777. I will check later with 755. For now, nagios is
running through docker on a dedicated server that I want to monitor. In
other words, I want to monitor the host where the docker nagios server is
running. I'm facing an issue with SSL handshake between nrpe service
installed on the host and the docker nagios server.
Is it a possible configuration? Or have I to install docker nagios server
on another host?
Thanks for your answer,
Best regards,
Nico
2018-07-05 17:36 GMT+02:00 Nicolas Loison <[email protected]>:
… I have pulled the latest image from 41 minutes ago. Where I can find the
UID, by ls -l on the docker-nagios directory i think ?
Best regards
2018-07-05 17:32 GMT+02:00 Valentin Hristev ***@***.***>:
> JasonRivers last post is that he fix permissions ,so pull the latest code
> and try again.
>
> As I said its a matter of user ownership ,so when you run the image you
> can see which user ID is creating files and chown to that ID
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#67 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/ARDT5ufBfRbun-nGGFteGf-pHcr7AwZWks5uDjF7gaJpZM4UKoph>
> .
>
|
@nicocolt This should work fine, I do exactly that, What version of NRPE are you running on the host? I recommend using version 3.2.1 (Which is what the nagios container is running), Is it failing for other hosts or only the host that the container is running on? Could you raise a new issue for this and include your config for monitoring the host? |
Hello,
I managed to get it works on my local environment.
I have added the docker bridge network in the allowed hosts in nrpe
configuration. By the way, I used a v2 nrpe, which cause some errors. I
have to installed v 3.2.1.
Thanks,
Nico
…--
2018-07-09 10:09 GMT+02:00 Jason Rivers <[email protected]>:
@nicocolt <https://github.com/nicocolt> This should work fine, I do
exactly that, What version of NRPE are you running on the host? I recommend
using version 3.2.1 (Which is what the nagios container is running), Is it
failing for other hosts or only the host that the container is running on?
Could you raise a new issue for this and include your config for monitoring
the host?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#67 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ARDT5uGX6MICJiZ55tgUqdbIc2zNvjqhks5uEw-ngaJpZM4UKoph>
.
|
Hello,
I can not find a way to install nrpre v3 other than by sources. On a
production server, I'm not pretty confident to install compilation
binaries. Is there a way to find a package binary for nrpe v3 on Ubuntu
server ?
Let me know,
Thanks.
Nico
…--
2018-07-11 16:54 GMT+02:00 Nicolas Loison <[email protected]>:
Hello,
I managed to get it works on my local environment.
I have added the docker bridge network in the allowed hosts in nrpe
configuration. By the way, I used a v2 nrpe, which cause some errors. I
have to installed v 3.2.1.
Thanks,
Nico
--
2018-07-09 10:09 GMT+02:00 Jason Rivers ***@***.***>:
> @nicocolt <https://github.com/nicocolt> This should work fine, I do
> exactly that, What version of NRPE are you running on the host? I recommend
> using version 3.2.1 (Which is what the nagios container is running), Is it
> failing for other hosts or only the host that the container is running on?
> Could you raise a new issue for this and include your config for monitoring
> the host?
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#67 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/ARDT5uGX6MICJiZ55tgUqdbIc2zNvjqhks5uEw-ngaJpZM4UKoph>
> .
>
|
I'm not sure about a binary package for NRPE I have always compiled from source because distro packages are always out of date. Please raise a new issue if you want further help. |
Closing as I believe original issue is resolved. |
This issue is not resolved yet.. |
same here |
It works like a dream for me...Thanks for sharing your experience 👍 |
Hello, just to say... I'm also getting this error with 4.4.3 version
|
https://github.com/mconf/nagios-etc/blob/master/nagiosgraph/ngshared.pm |
I had same issue. Then I realized because of I mount my own empty nagiosgraph/etc directory nagios can not see any conf and ngshared.pm file. I fixed issue by creating another container without any volume mount and copy all files from /opt/nagiosgraph/etc to old one. To fix these issue nagios_start may create all these files when etc directory is empty. |
I fell over this issue today and would recommend that the documentation/readme be updated. Recommending the volume mount for nagiosgraph-etc was added in PR 64 but I have opened PR 146 to remove that line from the readme.
Mounting an empty volume at that location hides these files. I would suggest that new users do not want that to happen and experienced users will be able to copy those files out before mounting a volume over it. |
Per the comments above I worked around this by creating a temporary container and copying (c=$(docker create jasonrivers/nagios:latest) && {
sudo docker cp -a $c:/opt/nagiosgraph/etc /HOST/PATH/TO/nagiosgraph
docker rm $c >/dev/null
}) |
I created my different dirs, chown 999 to nagios dirs.
I launched the same command as yours, but when I try to see a graph, i ve this error in my logs:
Can't locate ngshared.pm in @INC (you may need to install the ngshared module) (@INC contains: /opt/nagiosgraph/etc /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.22.1 /usr/local/share/perl/5.22.1 /usr/lib/x86_64-linux-gnu/perl5/5.22 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.22 /usr/share/perl/5.22 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at /opt/nagiosgraph/bin/insert.pl line 41. BEGIN failed--compilation aborted at /opt/nagiosgraph/bin/insert.pl line 41.
The text was updated successfully, but these errors were encountered: