Code Monkey home page Code Monkey logo

docker-nagios's Introduction

Docker-Nagios

Docker image for Nagios

Build Status: Build Status

Nagios Core 4.5.2 running on Ubuntu 22.04 LTS with NagiosGraph & NRPE

Product Version
Nagios Core 4.5.2
Nagios Plugins 2.4.10
NRPE 4.1.0
NCPA 3.1.0
NSCA 2.10.2

Configurations

Nagios Configuration lives in /opt/nagios/etc NagiosGraph configuration lives in /opt/nagiosgraph/etc

Install

docker pull jasonrivers/nagios:latest

Running

Run with the example configuration with the following:

docker run --name nagios4 -p 0.0.0.0:8080:80 jasonrivers/nagios:latest

alternatively you can use external Nagios configuration & log data with the following:

docker run --name nagios4  \
  -v /path-to-nagios/etc/:/opt/nagios/etc/ \
  -v /path-to-nagios/var:/opt/nagios/var/ \
  -v /path-to-custom-plugins:/opt/Custom-Nagios-Plugins \
  -v /path-to-nagiosgraph-var:/opt/nagiosgraph/var \
  -v /path-to-nagiosgraph-etc:/opt/nagiosgraph/etc \
  -p 0.0.0.0:8080:80 jasonrivers/nagios:latest

Note: The path for the custom plugins will be /opt/Custom-Nagios-Plugins, you will need to reference this directory in your configuration scripts.

There are a number of environment variables that you can use to adjust the behaviour of the container:

Environamne Variable Description
MAIL_RELAY_HOST Set Postfix relayhost
MAIL_INET_PROTOCOLS set the inet_protocols in postfix
NAGIOS_FQDN set the server Fully Qualified Domain Name in postfix
NAGIOS_TIMEZONE set the timezone of the server

For best results your Nagios image should have access to both IPv4 & IPv6 networks

Credentials

The default credentials for the web interface is nagiosadmin / nagios

Extra Plugins

docker-nagios's People

Contributors

chriskacerguis avatar dolber avatar dralbert avatar jasondyalog avatar jasonrivers avatar jay-eff avatar lordmike avatar lukvdborne avatar mmerian avatar romracer avatar scott-jones-cos avatar srstsavage avatar stonio avatar thefox avatar tmdoit avatar wmoore28 avatar your1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-nagios's Issues

WARNING: HTTP/1.1 401 Unauthorized

Hello,

I tried this container, however every time I run with the command provided, it always stuck on the following messages. I also unable to access the web page.

Could you please advise?

postfix/master[16]: daemon started -- version 3.1.0, configuration /etc/postfix
nagios: SERVICE ALERT: localhost;HTTP;WARNING;SOFT;1;HTTP WARNING: HTTP/1.1 401 Unauthorized - 695 bytes in 0.002 second response time
nagios: SERVICE ALERT: localhost;HTTP;WARNING;SOFT;2;HTTP WARNING: HTTP/1.1 401 Unauthorized - 695 bytes in 0.001 second response time
nagios: SERVICE ALERT: localhost;HTTP;WARNING;SOFT;2;HTTP WARNING: HTTP/1.1 401 Unauthorized - 695 bytes in 0.001 second response time
nagios: SERVICE ALERT: localhost;HTTP;WARNING;SOFT;3;HTTP WARNING: HTTP/1.1 401 Unauthorized - 695 bytes in 0.001 second

how to reload nagios ?

As I understand the only way to apply changes is to restart docker container?
IS there any other options to reload nagios?

persisting history

Hi,

currently, all historical information is lost when I restart the container (or even just the Nagios process from UI). I already have /opt/nagios/var as a mounted volume. What else can I do?

htpasswd file owners wrong if not default

Found probably something you missed when making a container.
The following row shows the issue of not taking into account modified nagios user. By the environment variables, you can define NAGIOS_USER and NAGIOS_GROUP:

chown -R nagios.nagios "${NAGIOS_HOME}/etc/htpasswd.users"

Populate /opt/nagiosgraph/[etc|var] if empty

Reported by @jtome

If one is mounting /opt/nagiosgraph/etc or /opt/nagiosgraph/var outside of the container, and the mounted directory is empty nagiosgraph fails to load, Files should be copied in place if the directory is empty.

How to add config .cfg files to the image

Hi,

I'm trying to extend your image and I'm trying to add my .cfg files into etc/conf.d dir.
I must be doing something wrong because after starting the container the folder is empty.

I tried also putting them in /orig/etc/conf.d with no luck.

Thanks

SMTP relay host gets overwritten when I start nagios?

Hopefully someone can help me with this, I am trying to set my relay host on container start up (/etc/postfix/main.cf), and if I look in my log file, it does get set, however after nagios starts I go look in the main.cf file and it is back to unset "relayhost ="

sed -i "s/relayhost =/relayhost =${SMTP_HOST}/g" /etc/postfix/main.cf
cat /etc/postfix/main.cf | grep relayhost >> /tmp/container-startup.log

We set the relay host in main.cf and then once we start nagios it gets blown away

echo "STARTUP Starting nagios..."
/usr/local/bin/start_nagios

Does anyone know why this is? As a bonus question, somehow between my host and container, it is picking up my real corporate SMTP host to send mail through and I have no idea how it is doing that, I never told the image to use my corporate SMTP server.

How to run the VMware ESXi plugin in the docker container?

I like to monitor my VMware EXSi server with Nagios. The ESXi plugin require the VMware perl CLI SDK installed. It seems not to be so easy to install this SDK. It starts, that the installer requires lsmod, which is not installed in the container. How is it possible to monitor the ESXi server with Nagios running in docker?

Unable to attach to web interface

I am running the first command to kick the tires on this image:
docker run --name nagiosdemo jasonrivers/nagios:latest

The container starts ok although I do see the following error periodically print to screen:
nagios: SERVICE ALERT: localhost;HTTP;WARNING;SOFT;1;HTTP WARNING: HTTP/1.1 401 Unauthorized - 695 bytes in 0.002 second response time

Consequently, when trying to connect to the web interface in FireFox I simply get "Unable to connect".

Now, the container is running on x64 Ubuntu 16. I have verified that there are no port conflicts.

Any guidance would be appreciated. Thanks.

missing libs to compile some plugins

checking for PQsetdbLogin in -lpq... no
configure: WARNING: Skipping PostgreSQL plugin (check_pgsql)
configure: WARNING: LIBS="-lcrypt " CPPFLAGS=""                                                                                                                                                                                                            
configure: WARNING: install PostgreSQL libs to compile this plugin (see REQUIREMENTS).                                                                                                                                                                     
checking for dbi_initialize in -ldbi... no
configure: WARNING: Skipping dbi plugin
configure: WARNING: install DBI libs to compile this plugin (see REQUIREMENTS).                                                                                                                                                                            
checking for rc_read_config in -lfreeradius-client... yes
checking for main in -lldap... configure: WARNING: Skipping LDAP plugin
configure: WARNING: install LDAP libs to compile this plugin (see REQUIREMENTS).                                                                                                                                                                           
no
checking linux/hdreg.h usability... yes
checking linux/hdreg.h presence... yes
checking for linux/hdreg.h... yes
checking linux/types.h usability... yes
checking linux/types.h presence... yes
checking for linux/types.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for mysql_config... no
configure: WARNING: Skipping mysql plugin
configure: WARNING: install mysql client libs to compile this plugin (see REQUIREMENTS).  

Build fails with snmp-mibs-downloader

Hello, build fails with error:

Package snmp-mibs-downloader is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'snmp-mibs-downloader' has no installation candidate

No changes were done to the repo, it's build of clean fork.

Timezone/Servername ENVs do not work

docker-compose:

---
version: '3'
services:
  nagios:
    image: jasonrivers/nagios:latest
    ports:
    - "8080:80"
    environment:
    - NAGIOS_FQDN=nagios.test.com
    - NAGIOS_TIMEZONE=CEST
    volumes:
    - /opt/nagios/etc/:/opt/nagios/etc/
    - /opt/nagios/var:/opt/nagios/var/
    - /opt/Custom-Nagios-Plugins/:/opt/Custom-Nagios-Plugins/
    - /opt/nagiosgraph/var/:/opt/nagiosgraph/var/
    - /opt/nagiosgraph/etc/:/opt/nagiosgraph/etc/

after running docker both ENVs "timezone and servername" still the same in orginal Container.
check in container :

 cat /etc/apache2/conf-available/timezone.conf
PassEnv TZ
cat /etc/apache2/conf-enabled/servername.conf
nagios.example.com

the timezone in Nagios Web still also in UTC
I had to fix that in Dockerfile like this:

FROM jasonrivers/nagios:latest
RUN rm /etc/localtime && ln -s /usr/share/zoneinfo/Europe/Berlin /etc/localtime
COPY servername.conf /etc/apache2/conf-available/servername.conf
COPY timezone.conf /etc/apache2/conf-available/timezone.conf

File timezone.conf

SetEnv TZ "Eourpe/Berlin"

File servername.conf

nagios.test.com

Wrong Date

Unfortunately the date is wrong under last check:, how can this be fixed?
wrongdate

Error - Could not open main config file

Hi Jason,
First off, thanks for all the great work.

So, the container runs with default config just fine, but when I point it to my actual config (on the VM in AWS), it gives this error message on UI:

"Error: Could not open main config file '/usr/local/nagios/etc/nagios.cfg' for reading!"

My config was pulled from a git repo and sits in usr/local/nagios/*

I started my container with this command:

docker run -d --name nagios4
-v /usr/local/nagios/etc/:/opt/nagios/etc/
-v /usr/local/nagios/var/:/opt/nagios/var/
-p 80:80 jasonrivers/Nagios

Here’s a pattern I see in logs:

Error: Failed to process config file '/opt/nagios/etc/nagios.cfg'. Aborting
nagios: Error in configuration file '/opt/nagios/etc/nagios.cfg' - Line 453 (Check result path '/usr/local/nagios/var/spool/checkresults' is not a valid directory)

Not sure why logs still show the /opt/nagios… location, and why it can’t read the nagios.cfg. Any help will be greatly appreciated.

Thanks

libnagios-plugin-perl

Would it be possible to include libnagios-plugin-perl in the apt installation list as well?

I have one perl plugin and it requires it to be installed, tried to override run command to apt install it and then run nagios, but seems not to work like that.

edit: found a solution, running bash -c "apt install -y libnagios-plugin-perl && /usr/local/bin/start_nagios"

how and where to add my own script

Hello, thanks for the Docker-nagios

I want to add my own script to exec some application when the container start, would you tell me how and where to add the script ?

raspberry pi 3 crash

WARNING: Published ports are discarded when using host network mode
standard_init_linux.go:190: exec user process caused "exec format error"

Build errors

Sorry, very much a 'newb' with Docker, but I believe that something upstream has changed in the past several weeks that affects your Dockerfile. I can run a pull request and run the container with no issue, but if I download your docker file and build it locally and try to run it, it won't run without errors. Once the container started it kept on throwing errors with run postfix, run nrpe, etc. I was trying to modify the Dockerfile to allow setting in the postfix conf files to behave with an MTA and got errors and finally got back to the issue that it wouldn't even build locally. Also if I use the image as the base of a docker-compose file I get the same errors.

nagios.qh bind failed

Hi,

I am running into this error:
nagios: qh: Failed to init socket '/opt/nagios/var/rw/nagios.qh'. bind() failed: Operation not permitted

I don't know why I am getting permission errors.
I am running docker with boot2docker.
Can it be the source of my problems?

Thanks,
Giacomo

Dumb user question

I cannot find anywhere how to access the UI? Any help? I am running the docker on a QNAP

Nagiosgraph not working

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.

Warning: This plugin must be either run as root or setuid root.

After restarting container. all hosts are DOWN.
Warning: This plugin must be either run as root or setuid root.

ls -la /opt/nagios/libexec/check_icmp
-rwsr-xr-x 1 nagios nagios 271424 Oct 16 08:52 /opt/nagios/libexec/check_icmp

Then i run
chmod u+s /opt/nagios/libexec/check_icmp

But when i restart container all hosts are DOWN. The problem is exist when i have upgraded container to 4.4.2

my docker-compose (using nagios:latest):

services:
  nagios:
    network_mode: "bridge"
    extends:
      file: docker-compose.yml
      service: nagios 
    container_name: nagios 
    environment:
      VIRTUAL_HOST: my.domain.com
      MAIL_RELAY_HOST: ${MAIL_RELAY_IP}
      NAGIOS_FQDN: my.domain.com
      NAGIOS_TIMEZONE: Europe/Kiev 
    volumes:
      - /data/nagios/etc/:/opt/nagios/etc/
      - /data/nagios/var:/opt/nagios/var/
      - /data/nagios/custom-plugins:/opt/Custom-Nagios-Plugins
      - /data/nagios/nagiosgraph-var:/opt/nagiosgraph/var \
      - /data/nagios/nagiosgraph-etc:/opt/nagiosgraph/etc \

Unmark /opt/nagios/etc as a docker volume?

At work we are migrating our nagios server to a dockerized setup using this docker container.
However, we are currently limited to an image without access to any external volumes.
This is giving us problems because docker undos all changes that are made to files located in a folder that is also marked as a volume (such as /opt/nagios/etc).

Would it be possible to unmark this folder as a volume?
Pro would be that the config could be copied / modified directly inside the docker container, reducing the complexity of the setup.
Con would be that existing users that already use a volume now would have to add a volume directive for /opt/nagios/etc in their Dockerfile.

Nagios app for Android anag CGI PATH not working

Dear Jason,

Hope you are doing well, I am trying to connect my Nagios Server with Nagios Free app for android ==> anag but I am unable to connect, all environment variable paths I tried but no result,

ENV NG_CGI_URL /cgi-bin
NV NG_CGI_DIR ${NAGIOS_HOME}/sbin

I would appreciate you help and guidance.

Regards

A little question about nagios.cfg

In Dockerfile, line 154~157, you've already change the nagios.cfg, :

echo "use_timezone=$NAGIOS_TIMEZONE" >> ${NAGIOS_HOME}/etc/nagios.cfg && \ echo "SetEnv TZ \"${NAGIOS_TIMEZONE}\"" >> /etc/apache2/conf-enabled/nagios.conf && \ echo "cfg_dir=${NAGIOS_HOME}/etc/conf.d" >> ${NAGIOS_HOME}/etc/nagios.cfg && \ echo "cfg_dir=${NAGIOS_HOME}/etc/monitor" >> ${NAGIOS_HOME}/etc/nagios.cfg && \

Why ADD nagios.cfg again in line 167 ?
ADD nagios/nagios.cfg /opt/nagios/etc/nagios.cfg

It looks like will be override, I think.

authorized question

hi
when i run docker image with follow command
docker run --name nagios4 -p 0.0.0.0:8080:80 jasonrivers/nagios:latest
i notice log that " Adding password for user nagiosadmin "
when i put mu linux ip:port(1.2.3.4:8080) on website user/password required
assuming that my linux user/password like <bk/123456>
both failed when i try user/password (bk/123456 or nagiosadmin/ )
what can i do is correct?
thank you a lot ~

Nagios does not verify config correctly with bind mounts

Greetings,

I can run Nagios given the config in the image, but I run into issues when I create my own config. I am not sure if I am making a mistake running Nagios in the way I do, though.

Since I only removed the localhost.cfg and added 3 more simple hosts, I can't see where my error is.

Steps I have taken:

Get image:

  • docker pull jasonrivers/nagios:4.3.2

Get data from inside container:

  • docker run --name nagios4 -p 0.0.0.0:8080:80 jasonrivers/nagios:4.3.2
  • docker exec -it nagios4 bash
  • <create tar archive of /opt>
  • docker cp nagios4:/opt.tar .
  • docker stop nagios4
  • docker rm nagios4

Customize:

  • Copy contents of /opt/nagios/etc and structure for /opt/nagios/var into bind mounts (no files), repeat for /opt/nagiosgraph
  • Add new hosts and commands

Run Nagios with bind mounts:

  • docker run -p 8080:80 --mount type=bind,source=/srv/conf/nagios,target=/opt/nagios/etc --mount type=bind,source=/srv/db/nagios,target=/opt/nagios/var --mount type=bind,source=/srv/conf/nagiosgraph,target=/opt/nagiosgraph/etc --mount type=bind,source=/srv/db/nagiosgraph,target=/opt/nagiosgraph/var/rrd --mount type=bind,source=/srv/logs/nagiosgraph,target=/opt/nagiosgraph/var/log --name=sce-1-nagios -d jasonrivers/nagios:4.3.2

  • Top of my nagios.cfg (removing #):

log_file=/opt/nagios/var/nagios.log
cfg_file=/opt/nagios/etc/objects/commands.cfg
cfg_file=/opt/nagios/etc/objects/contacts.cfg
cfg_file=/opt/nagios/etc/objects/timeperiods.cfg
cfg_file=/opt/nagios/etc/objects/templates.cfg
cfg_dir=/opt/nagios/etc/conf.d/
object_cache_file=/opt/nagios/var/objects.cache
precached_object_file=/opt/nagios/var/objects.precache
resource_file=/opt/nagios/etc/resource.cfg
status_file=/opt/nagios/var/status.dat
  • Host 1 definition (Removing #):
define host{
        use                     linux-server         
        host_name               sce-1.concurrent.systems
        alias                   sce-1.concurrent.systems
        address                	<removed> 
        }
define service{
        use                             local-service,graphed-service  
        host_name                       sce-1.concurrent.systems
        service_description             PING
	check_command			check_ping!100.0,20%!500.0,60%
        }
  • There are 2 more hosts defined identically, just with different names.

  • Docker logs sce-1-nagios:

Nagios Core 4.3.2
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 2017-05-09
License: GPL

Website: https://www.nagios.org
Nagios 4.3.2 starting... (PID=4820)
Local time is Tue May 29 13:26:52 UTC 2018
nerd: Channel hostchecks registered successfully
nerd: Channel servicechecks registered successfully
nerd: Channel opathchecks registered successfully
nerd: Fully initialized and ready to rock!
wproc: Successfully registered manager as @wproc with query handler
nagios: Nagios 4.3.2 starting... (PID=4820)
nagios: Local time is Tue May 29 13:26:52 UTC 2018
nagios: LOG VERSION: 2.0
nagios: qh: Socket '/opt/nagios/var/rw/nagios.qh' successfully initialized
nagios: qh: core query handler registered
nagios: nerd: Channel hostchecks registered successfully
nagios: nerd: Channel servicechecks registered successfully
nagios: nerd: Channel opathchecks registered successfully
nagios: nerd: Fully initialized and ready to rock!
nagios: wproc: Successfully registered manager as @wproc with query handler
wproc: Registry request: name=Core Worker 4821;pid=4821
nagios: wproc: Registry request: name=Core Worker 4821;pid=4821
wproc: Registry request: name=Core Worker 4822;pid=4822
nagios: wproc: Registry request: name=Core Worker 4822;pid=4822
wproc: Registry request: name=Core Worker 4823;pid=4823
nagios: wproc: Registry request: name=Core Worker 4823;pid=4823
wproc: Registry request: name=Core Worker 4824;pid=4824
Warning: Duplicate definition found for host 'sce-1.concurrent.systems' (config file '/opt/nagios/etc/conf.d/sce-1.cfg', starting on line 24)
Error: Could not add object property in file '/opt/nagios/etc/conf.d/sce-1.cfg' on line 28.
Error: Invalid max_check_attempts value for host 'sce-1.concurrent.systems'
Error: Could not register host (config file '/opt/nagios/etc/conf.d/sce-1.cfg', starting on line 24)
Bailing out due to one or more errors encountered in the configuration files. Run Nagios from the command line with the -v option to verify your config before restarting. (PID=4820)
nagios: wproc: Registry request: name=Core Worker 4824;pid=4824
nagios: Warning: Duplicate definition found for host 'sce-1.concurrent.systems' (config file '/opt/nagios/etc/conf.d/sce-1.cfg', starting on line 24)
nagios: Error: Could not add object property in file '/opt/nagios/etc/conf.d/sce-1.cfg' on line 28.
nagios: Error: Invalid max_check_attempts value for host 'sce-1.concurrent.systems'
nagios: Error: Could not register host (config file '/opt/nagios/etc/conf.d/sce-1.cfg', starting on line 24)
nagios: Bailing out due to one or more errors encountered in the configuration files. Run Nagios from the command line with the -v option to verify your config before restarting. (PID=4820)
nagios: Event broker module 'NERD' deinitialized successfully.

Running nagios -v inside the container give the same errors as above.

check_nrpe -H <<Host>> always return "connection refused"

screen shot 2017-03-06 at 11 34 02 pm

I have the nagios server up and running (I have checked it thoroughly) along with the nagios client on my Host <<192.168.43.110>>. I have also tried to ping the container's locahost
screen shot 2017-03-06 at 11 36 32 pm

And I get the same problem again

Also, the web interface of Nagios Core shows perfectly the two hosts (192.168.43.110 and localhost), but I am unable to check with the check_nrpe command.

I believe this is something specific to this container which is causing the problem. Any ideas?

Nagios Not Running

Hello,
I installed Nagios using this command :

docker run --name nagios -d
-v /home/noveladmin/docker-data/nagios/etc/:/opt/nagios/etc/
-v /home/noveladmin/docker-data/nagios/var:/opt/nagios/var/
-v /home/noveladmin/docker-data/nagios/custom-plugins:/opt/custom-nagios-plugins
-p 0.0.0.0:8080:80 jasonrivers/nagios:latest

When I connect to the Nagios interface I have "Nagios Not Running" and looking at the logs I have the following message, while the file "var" have all permission

[1496840486] Error: Unable to create temp file '/opt/nagios/var/nagios.tmpVH2FFU' for writing status data: Permission denied
[1496840487] Warning: File '/opt/nagios/var/perfdata.log' could not be opened - service performance data will not be written to file!
[1496840496] Error: Unable to create temp file '/opt/nagios/var/nagios.tmpWQHhrq' for writing status data: Permission denied
[1496840497] Warning: File '/opt/nagios/var/perfdata.log' could not be opened - service performance data will not be written to file!
[1496840506] Error: Unable to create temp file '/opt/nagios/var/nagios.tmpZ2vYkm' for writing status data: Permission denied
[1496840507] Warning: File '/opt/nagios/var/perfdata.log' could not be opened - service performance data will not be written to file!
[1496840516] Error: Unable to create temp file '/opt/nagios/var/nagios.tmpwG7KmI' for writing status data: Permission denied
[1496840517] Warning: File '/opt/nagios/var/perfdata.log' could not be opened - service performance data will not be written to file!
[1496840526] Error: Unable to create temp file '/opt/nagios/var/nagios.tmp35RIwu' for writing status data: Permission denied
[1496840527] Warning: File '/opt/nagios/var/perfdata.log' could not be opened - service performance data will not be written to file!
[1496840536] Error: Unable to create temp file '/opt/nagios/var/nagios.tmpycCVOG' for writing status data: Permission denied
[1496840537] Warning: File '/opt/nagios/var/perfdata.log' could not be opened - service performance data will not be written to file!
[1496840546] Error: Unable to create temp file '/opt/nagios/var/nagios.tmpZiyefj' for writing status data: Permission denied
[1496840547] Warning: File '/opt/nagios/var/perfdata.log' could not be opened - service performance data will not be written to file!
[1496840556] Error: Unable to create temp file '/opt/nagios/var/nagios.tmpPhzVNl' for writing status data: Permission denied
[1496840557] Warning: File '/opt/nagios/var/perfdata.log' could not be opened - service performance data will not be written to file!
[1496840566] Error: Unable to create temp file '/opt/nagios/var/nagios.tmpDFLzuO' for writing status data: Permission denied
[1496840567] Warning: File '/opt/nagios/var/perfdata.log' could not be opened - service performance data will not be written to file!
[1496840576] Error: Unable to create temp file '/opt/nagios/var/nagios.tmpeqiqjH' for writing status data: Permission denied
[1496840577] Warning: File '/opt/nagios/var/perfdata.log' could not be opened - service performance data will not be written to file!

pnp4nagios support

Hello again Jason and thank you for keeping up this great build.

I have been using your nagios build for a while and one thought have crossed my mind. Do you think you will ever support pnp4nagios in your build? Looks like pnp4nagios is a bit more consistent and stable solution, also it is still supported and latest release was last year (https://github.com/lingej/pnp4nagios)

Define as volumes the etc and var dir of the nagiosgraph installation

First of all, congratulations and thanks for this project.

Second, I would like to suggest to define as docker volumes also the directories of Nagiosgraph....

  • /opt/nagiosgraph/etc
  • /opt/nagiosgraph/var

At least in my case I usually have to made some adjusts in the Nagiosgraph configuration in order to support the different services I define in Nagios (in the datasetdb.conf file) and also I think that it is important to be able to persist the graphs generated by Nagiosgraph (that are located in the var directory).

Thanks in advance.

Nagios not accessible

Hi I run your docker image with nagios. It worked fine until this morning. after an restart I cannot access the UI via the port.
Service is running I htop shows the checks

what could be the issue?

Nagios with HTTPS

  • How can I use Nagios via HTTPS ?
  • How can I mount my SSL certificates?

Code license

I have a project that I’d like to use the docker-nagios, however it currently doesn't have a license.

Would you consider releasing it under an open source license?

Bulk Questions

Hi Jason,

I have few questions and would appreciate your assistance. I could launch Nagios UI and see localhost in it.

I would like to know how to monitor its own host and another host. Do you have documentation for that ?

Please advise

Thanks
Ameya

NSCA Plugin setup

Hi,

As the title says, have your considered integrating NSCA plugin ?

Thanks

Changing webadmin user and pass

Seems like with the current setup it is not possible to change the user and password.

When I use the environment variables on swarm, where it might have data folders already created and restart the nagios container. It will not change the user nor password due to file already existing.

if [ ! -f "${NAGIOS_HOME}/etc/htpasswd.users" ] ; then

From htpasswd documentation I can read out that current flags set on file creation might not be the best
https://httpd.apache.org/docs/current/programs/htpasswd.html

-c Create the passwd file. If passwd file already exists, it is rewritten and truncated. This option cannot be combined with the -n option.
-s Use SHA encryption for passwords. Facilitates migration from/to Netscape servers using the LDAP Directory Interchange Format (ldif). This algorithm is insecure by today's standards.
-b Use batch mode; i.e., get the password from the command line rather than prompting for it. This option should be used with extreme care, since the password is clearly visible on the command line. For script use see the -i option. Available in 2.4.4 and later.

"-c" one is ok, and will make the bash check if file exists even redundant and would make it to overwrite it.
"-b" seems ok, will just let the creation from bash.
"-s" seems a bit bad choice, since authentication is handled by apache only, I don't think there is a need to use SHA. Default is MD5 and -B gives bcrypt which is considered as very secure, at least by the documentation there.

Distributed Monitoring

Hi,

Have you try it to include Gearman server to perform a distributed monitoring?

I had tried Gearman Server with Nagios using CentOS and Raspberry pi as a workers.

How to stop nagios in container

How can I stop nagios inside container without automatic stop of complete docker container. I want to replace /opt/nagios with an "old" one with backup data inside...

NSCA server ?

Hello,
have you considered adding nsca server to this image ? This would allow passive checks to be sent to the container.

Have a nice day.

"{conf.d,monitor}" folder

First of all, thank you for this wonderful image.

I believe your line in your "latest" Dockerfile corrupts the Nagios folder /opt/nagios/etc

mkdir -p         ${NAGIOS_HOME}/etc/{conf.d,monitor}

This creates literally a folder with the name {conf.d,monitor}, instead of the two folders, as in the previous releases.

Naturally, my suggestion is to replace this line with two:

mkdir -p         ${NAGIOS_HOME}/etc/conf.d
mkdir -p         ${NAGIOS_HOME}/etc/monitor

Best,
Eduardo

Mail Notifications

I've might missed something:
How do you configure the mail sending from the Docker?
As of my tests I couldn't find a way to send mail from the nagios.
How did you fixed the issue?

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.