Skip to content
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

Adding snmp traps support (Informational, don't expect this to be merged in) #98

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*.pyc
cpu-usage-data.json
.DS_Store
14 changes: 9 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ EXPOSE 8080
ADD sendEmail-epel-7.repo /etc/yum.repos.d/

RUN yum install -y epel-release && \
INSTALL_PKGS="httpd nagios telnet supervisor python-jinja2 nagios-plugins-all sendEmail perl-Net-SSLeay perl-IO-Socket-SSL" && \
INSTALL_PKGS="httpd telnet supervisor python-jinja2 nagios-plugins-all sendEmail perl-Net-SSLeay perl-IO-Socket-SSL" && \
yum -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \
rpm -V $INSTALL_PKGS && \
yum clean all && \
Expand All @@ -18,16 +18,20 @@ RUN yum install -y epel-release && \
/etc/httpd/conf/httpd.conf && \
touch /supervisord.log /supervisord.pid && \
mkdir -p /var/log/nagios/archives /var/log/nagios/rw/ /var/log/nagios/spool/checkresults /opt/rhmap/nagios/plugins/lib && \
chmod -R 777 /supervisord.log /supervisord.pid /var/log/nagios \
/etc/httpd /etc/passwd /var/log /etc/nagios /usr/lib64/nagios \
/var/spool/nagios /run /usr/share/httpd /usr/share/nagios && \
chmod -R 777 /supervisord.log /supervisord.pid \
/etc/httpd /etc/passwd /var/log \
/run /usr/share/httpd
COPY ./nagios-4.0.8-2.el7.x86_64.rpm .
RUN yum localinstall -y --nogpgcheck ./nagios-4.0.8-2.el7.x86_64.rpm
RUN chmod -R 777 /usr/share/nagios /etc/nagios /usr/lib64/nagios /var/log/nagios /var/spool/nagios && \
sed -i -e 's|cfg_file=/etc/nagios/objects/localhost.cfg||' /etc/nagios/nagios.cfg

COPY supervisord.conf /etc/supervisord.conf
COPY make-nagios-fhservices-cfg make-nagios-commands-cfg fhservices.cfg.j2 commands.cfg.j2 /opt/rhmap/
COPY plugins/default/ /opt/rhmap/nagios/plugins/
COPY scripts/ /opt/rhmap/
RUN chmod -R 755 /opt/rhmap/nagios/plugins/
COPY start /start
COPY snmp-scripts /usr/local/bin/
COPY mibs/ /usr/share/snmp/mibs

CMD ["/start"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,4 @@ To bump the version for nagios-container:
* Go to the [nagios_container_pullrequests](http://bob.feedhenry.net:8080/job/nagios-container_pullrequests/) job in Jenkins
* Configure
* Go to `Execute shell`
* Bump the version at `VERSION=""`
* Bump the version at `VERSION=""`
25 changes: 24 additions & 1 deletion fhservices.cfg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ define contact {
define contactgroup {
contactgroup_name rhmapadmins
alias RHMAP Administrators
members rhmapadmin
members rhmapadmin, managementstation
}

define hostgroup {
Expand Down Expand Up @@ -362,3 +362,26 @@ define service {
notes One or more containers has no limit set for CPU and/or Memory.
contact_groups rhmapadmins
}

# 'send-service-trap' command definition
define command{
command_name send-service-trap
command_line /usr/local/bin/send-service-trap manager public "$HOSTNAME$" "$SERVICEDESC$" $SERVICESTATEID$ "$SERVICEOUTPUT$"
}

# 'send-host-trap' command definition
define command{
command_name send-host-trap
command_line /usr/local/bin/send-host-trap manager public "$HOSTNAME$" $HOSTSTATEID$ "$HOSTOUTPUT$"
}

define contact{
contact_name managementstation
use generic-contact
alias Management Station
service_notification_options w,u,c,r
host_notification_options d,u,r
service_notification_commands send-service-trap
host_notification_commands send-host-trap
}

Loading