Comments (3)
I have not been able either, @JasonRivers any guidance on this topic?
from docker-nagios.
I have a custom script for this currently, Perhaps I should include it in the container,
my custom script looks like this:
#!/bin/bash
NOTIFICATION_TYPE=$1
if [ "$NOTIFICATION_TYPE" = "service" ]; then
## This is a service notification
SUBJECT="[NAGIOS] ${NAGIOS_NOTIFICATIONTYPE}: ${NAGIOS_SERVICEDESC} on ${NAGIOS_HOSTNAME} is ${NAGIOS_SERVICESTATE}"
MAILBODY="***** Nagios *****\n\nNotification Type: ${NAGIOS_NOTIFICATIONTYPE}\n\nHost\n\nService: ${NAGIOS_SERVICEDESC}\nHost: ${NAGIOS_HOSTNAME}\nAddress: ${NAGIOS_HOSTADDRESS}\nState: ${SERVICESTATE}\n\nDate/Time: ${NAGIOS_LONGDATETIME}\n\nAdditional Info:\n\n${NAGIOS_SERVICEOUTPUT}"
else
## This is a host notification
SUBJECT="[NAGIOS] ${NAGIOS_NOTIFICATIONTYPE}: ${NAGIOS_HOSTNAME} is ${NAGIOS_HOSTSTATE}"
MAILBODY="***** Nagios *****\n\nNotification Type: $NAGIOS_NOTIFICATIONTYPE\n\nHost: $NAGIOS_HOSTNAME\nAddress: $NAGIOS_HOSTADDRESS\nState: $NAGIOS_HOSTSTATE\n\nDate/Time: $NAGIOS_LONGDATETIME\n\nAdditional Info:\n\n$NAGIOS_HOSTOUTPUT"
fi
if [ ${NAGIOS_CONTACTEMAIL} ]; then
MAILFROM="Nagios Monitor <[email protected]>"
/usr/sbin/sendmail -t -i -f "$MAILFROM" <<EOF
From: $MAILFROM
To: $NAGIOS_CONTACTEMAIL
Subject: $SUBJECT
$MAILBODY
EOF
fi
My notify_commands.cfg has this:
define command {
command_name notify-service-by-email
command_line $USER4$/notify_by_email service
}
and the following in contacts.cfg:
define contact {
contact_name JasonEmail
alias Jason Rivers (Email)
use Email
email [email protected]
contact_groups Admins
service_notification_period WorkHours
host_notification_period WorkHours
}
I have a separate contact for services that I want to be notified of 24/7, along with XMPP notifications and SMS notifications.
Hopefully this helps get you up and running, I'll see about including the notify_by_email script within the image
from docker-nagios.
thank you @JasonRivers, I also notice that I was not even able to "sendmail" from the container because it's in a Corporate Network so I also had to update Postfix (/etc/postfix/main.cf) to include
myhostname = [linuxboxURL]
relayhost = [corporateSMTPServerURL]
Hope this also helps other people
from docker-nagios.
Related Issues (20)
- Nagios script request : check_apc.pl HOT 1
- Apache2 and NSCA not removing PID on reboot HOT 4
- Unable to get process status HOT 5
- Segmentation fault (core dumped) running nagios HOT 8
- NRPE plugin not installed in the container? HOT 2
- ENVs are not populated using notify_by_xmpp
- Nagios service does not start HOT 1
- HTTPS Options? HOT 2
- wrong data from remote server
- No map shown when using Umlaut in alias HOT 2
- postfix username and password for AWS SES HOT 1
- Not using nsca fills up the docker log file
- Web UI doesnt showup any config data
- Ruby missing from the Dockerfile
- permiussion denied
- Not work the config SMTP to send email
- Performance issues HOT 1
- there's already an NSCA server running (PID 16). Bailing out... HOT 2
- Adding comments does not work
- Will you upgrade Nagios to the current version?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-nagios.