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

Add 'Stats' section with Nagiosgraph links to Nagios sidebar. #48

Open
wants to merge 1 commit 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
11 changes: 8 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,17 @@ ADD rsyslog.init /etc/sv/rsyslog/run
ADD start.sh /usr/local/bin/start_nagios
RUN chmod +x /usr/local/bin/start_nagios

ADD fix-nagiosgraph-multiple-selection.sh /opt/nagiosgraph/etc
ADD nagiosgraph-mod/fix-nagiosgraph-multiple-selection.sh /opt/nagiosgraph/etc

RUN cd /opt/nagiosgraph/etc && \
sh fix-nagiosgraph-multiple-selection.sh
sh fix-nagiosgraph-multiple-selection.sh && \
rm fix-nagiosgraph-multiple-selection.sh

RUN rm /opt/nagiosgraph/etc/fix-nagiosgraph-multiple-selection.sh
ADD nagiosgraph-mod/add-nagiosgraph-sidebar-links.sh /opt/nagios/share

RUN cd /opt/nagios/share && \
sh add-nagiosgraph-sidebar-links.sh && \
rm add-nagiosgraph-sidebar-links.sh

# enable all runit services
RUN ln -s /etc/sv/* /etc/service
Expand Down
27 changes: 27 additions & 0 deletions nagiosgraph-mod/add-nagiosgraph-sidebar-links.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash
#################################################################
#
# Author: Tomasz Matejunas [email protected] digitaloak.it
# Description: Script adds nagiosgraph links (Stats section)
# to nagios sidebar
#
# Run script from nagios/share folder where
# is side.php script (this script will be modified)
#
##################################################################
sed '
/<\/body>/ i\
<div class="navsection">\
<div class="navsectiontitle">Stats</div>\
<div class="navsectionlinks">\
<ul class="navsectionlinks">\
<li><a href="/nagios/cgi-bin/show.cgi" target="main">Graphs</a></li>\
<li><a href="/nagios/cgi-bin/showhost.cgi" target="main">Graphs by Host</a></li>\
<li><a href="/nagios/cgi-bin/showservice.cgi" target="main">Graphs by Service</a></li>\
<li><a href="/nagios/cgi-bin/showgroup.cgi" target="main">Graphs by Group</a></li>\
</ul>\
</div>\
</div>
' side.php > side.php2
rm side.php
mv side.php2 side.php