ethnchao / docker-nagios

Docker-Nagios provide Nagios service running on the docker container and a series of solution for Nagios
48 stars 33 forks source link

Objects with okconfig. Where are they written? #6

Closed jangeador closed 2 years ago

jangeador commented 4 years ago

I am trying to figure this out. I will go in a clean installation add hosts using okconfig. The hosts are visible in adagios, in nagios, and in okconfig, but I cannot figure out where they are being written. I need to have access to those files to be able to backup. I am not using ndo-utils. I have searched up and down the file system of the container and I cannot find any of the files generated. Please help.

wolfen351 commented 4 years ago

I had the same issue and looked in the container - I found they are written here: /usr/local/nagios/etc/okconfig

Using this info I mounted this directory on the docker host, and then I could see/use/backup all the configs directly on the host

dberardo-com commented 3 years ago

i have also struggled quite a bit to figure out how not to lose data after restarting the container.

My solutions was mounting persistent volumes to the directories:

i hope that is enough.

Please add this piece of documentation in the README as this was a huge time waste.

now i am struggling to figure out how to setup and test SMTP configuration to send emails, seems that the info in the doc is not really helpful, as i cannot find any s-nail file in the /etc folder ...

dberardo-com commented 3 years ago

i have mounted a smtp config file using this guide: https://www.systutorials.com/sending-email-from-mailx-command-in-linux-using-gmails-smtp/

the config file is mounted root/.mailrc and /etc/s-nail.rc

i had to override the notify-host-by-email and notify-service-by-email commands since they where trying to call /usr/usr/bin/mail .... so i had to remove the first "usr" from the path. This looks like a bug