Browse Source

Adding Sharingan

master
DarkFeather 5 years ago
parent
commit
72cb1f4ba0
  1. 1
      IRC/README
  2. 261
      IRC/dialogs.css
  3. 16
      IRC/ircweb.service
  4. 4
      IRC/qchat-run.bash
  5. 25
      IRC/qchat.bash
  6. BIN
      IRC/qchat.tar.gz
  7. 298
      IRC/qui.mcss
  8. 59
      Sharingan/Makefile
  9. 396
      Sharingan/nagios.d/cgi.cfg
  10. 312
      Sharingan/nagios.d/daemon-init
  11. 34
      Sharingan/nagios.d/groups/hostgroups.cfg
  12. 39
      Sharingan/nagios.d/hosts/armature.cfg
  13. 101
      Sharingan/nagios.d/hosts/bastion.cfg
  14. 277
      Sharingan/nagios.d/hosts/core.cfg
  15. 122
      Sharingan/nagios.d/hosts/darknet.cfg
  16. 95
      Sharingan/nagios.d/hosts/geth-hub-1.cfg
  17. 95
      Sharingan/nagios.d/hosts/geth-hub-2.cfg
  18. 96
      Sharingan/nagios.d/hosts/geth-hub-3.cfg
  19. 67
      Sharingan/nagios.d/hosts/hypervisor.cfg
  20. 70
      Sharingan/nagios.d/hosts/print.cfg
  21. 47
      Sharingan/nagios.d/hosts/shadowfeed.cfg
  22. 106
      Sharingan/nagios.d/hosts/sharingan.cfg
  23. 1292
      Sharingan/nagios.d/nagios.cfg
  24. 300
      Sharingan/nagios.d/objects/commands.cfg
  25. 54
      Sharingan/nagios.d/objects/contacts.cfg
  26. 84
      Sharingan/nagios.d/objects/printer.cfg
  27. 112
      Sharingan/nagios.d/objects/switch.cfg
  28. 186
      Sharingan/nagios.d/objects/templates.cfg
  29. 93
      Sharingan/nagios.d/objects/timeperiods.cfg
  30. 144
      Sharingan/nagios.d/objects/windows.cfg
  31. 12
      Sharingan/sharingan-proxy.conf
  32. 13
      Sharingan/sharingan.conf
  33. 45
      Sora/ldap-adduser.bash
  34. 51
      Sora/ldap-user-report.bash

1
IRC/README

@ -1 +0,0 @@
This requires python2-twisted 15.0.0-1 -- ShadowArch users will need the downgrader(AUR) package to restore to this version and will need to mark the package for ignoring in Pacman.

261
IRC/dialogs.css

@ -1,261 +0,0 @@
/* AniNIX-specific additions */
body {
margin: 0;
height: 100%;
overflow: hidden;
font-family: Verdana, sans-serif;
font-size: 1.25em;
}
a, a:link, a:visited {
color: #F00;
text-decoration: underline;
background-color: #000;
}
a:hover, a:active {
color: #FFF;
text-decoration: none;
background-color: #000;
}
input {
color: #FFF;
background-color: #000;
border-color: #F00;
}
select {
color: #F00;
background-color:#000;
border: #F00 solid 3px;
}
h1 {
color: #FFF;
}
/**************** LOGIN BOX *******************/
.qwebirc-centrebox {
height: 100%;
width: 100%;
}
.qwebirc-centrebox table {
width: 100%;
}
.qwebirc-centrebox table table {
width: auto;
}
.qwebirc-loginbox .tr1 td {
width: 100%;
text-align: center;
}
.qwebirc-loginbox .tr2 td {
vertical-align: top;
}
.qwebirc-loginbox .tr2 table {
margin-left: auto;
margin-right: auto;
text-align: left;
}
/**************** CONFIRM LOGIN BOX *******************/
.qwebirc-confirmbox {
width: 100%;
width: auto !important;
margin: auto;
vertical-align: middle;
}
.qwebirc-confirmbox .tr1 td {
width: 100%;
vertical-align: bottom;
text-align: center;
}
.qwebirc-confirmbox .tr2 td {
vertical-align: top;
text-align: left;
}
.qwebirc-confirmbox .tr2 table {
margin-left: auto;
margin-right: auto;
}
/**************** ABOUT PANE *******************/
.qwebirc-aboutpane {
font-size: 1em !important;
}
.qwebirc-aboutpane .mainbody {
font-size: 0.8em;
text-align: center;
padding: 5px;
}
.qwebirc-aboutpane table {
display: inline-block;
}
.qwebirc-aboutpane div.header {
padding-top: 5px;
}
.qwebirc-aboutpane .header {
background: BLACK;
text-align: center;
border-bottom: 1px solid gray;
padding-bottom: 5px;
}
.qwebirc-aboutpane .header .title {
font-size: 3em;
}
.qwebirc-aboutpane .header .subtitle {
text-align: center;
margin-top: 10px;
}
.qwebirc-aboutpane .skipmargin {
margin-top: 0px;
}
/**************** EMBEDDED WIZARD *******************/
div.qwebirc-embeddedwizard {
padding-left: 5px;
padding-top: 2px;
}
.qwebirc-embeddedwizard input.text {
width: 300px;
}
.qwebirc-embeddedwizard input.iframetext {
width: 95%;
}
.qwebirc-embeddedwizard div.wizardcontrols {
}
.qwebirc-embeddedwizard .wizardcontrols input {
width: 70px;
}
/****** FEEDBACK ***********/
.qwebirc-feedbackpane {
font-size: 1em !important;
}
.qwebirc-feedbackpane .mainbody {
font-size: 0.8em;
text-align: center;
padding: 5px;
}
.qwebirc-feedbackpane table {
display: inline-block;
}
.qwebirc-feedbackpane div.header {
padding-top: 5px;
}
.qwebirc-feedbackpane .header {
background: BLACK;
text-align: center;
border-bottom: 1px solid gray;
padding-bottom: 5px;
}
.qwebirc-feedbackpane .header .title {
font-size: 3em;
}
.qwebirc-feedbackpane .header .subtitle {
text-align: center;
margin-top: 10px;
}
.qwebirc-feedbackpane .monospace {
font-family: Consolas, "Lucida Console", monospace;
}
/************* FAQ *****************/
.qwebirc-faqpane {
font-size: 1em !important;
}
.qwebirc-faqpane .mainbody {
font-size: 0.8em;
text-align: center;
padding: 5px;
margin-left: 20px;
margin-right: 20px;
}
.qwebirc-faqpane table {
display: inline-block;
}
.qwebirc-faqpane div.header {
padding-top: 5px;
}
.qwebirc-faqpane .header {
background: BLACK;
text-align: center;
border-bottom: 1px solid gray;
padding-bottom: 5px;
}
.qwebirc-faqpane .header .title {
font-size: 3em;
}
.qwebirc-faqpane .header .subtitle {
text-align: center;
margin-top: 10px;
}
.qwebirc-faqpane .monospace {
font-family: Consolas, "Lucida Console", monospace;
}
.qwebirc .loading {
padding-left: 4px;
padding-top: 3px;
font-size: 0.8em;
}
/************* OPTIONS *****************/
.qwebirc-optionspane div.hue-slider {
border: 0px solid WHITE;
width: 360px;
height: 8px;
background-image: url(../images/hue.png);
}
.qwebirc-optionspane div.hue-slider .knob {
width: 8px;
height: 16px;
top: -5px;
opacity: 0.75;
background: grey;
border: 1px solid WHITE;
}
/**************** RECAPTCHA *******************/
/* This border style lifted from qui.mcss */
#recaptcha_image {
border: 1px solid #c8d2dc;
}
.qwebirc-recaptcha-incorrect {
color: WHITE;
}

16
IRC/ircweb.service

@ -1,16 +0,0 @@
[Unit]
Description=AniNIX::IRC WebChat
After=network.target irc.service ircservices.service
[Service]
ExecStart=/bin/bash /opt/qchat-run.bash
ExecReload=/bin/bash -c "/bin/kill -HUP $MAINPID "'$(cat /usr/local/src/ArchLinuxAUR/qchat/twistd.pid)'""
PIDFile=/usr/local/src/ArchLinuxAUR/qchat/twistd.pid
KillMode=process
Restart=always
User=ircd
Group=ircd
[Install]
WantedBy=multi-user.target

4
IRC/qchat-run.bash

@ -1,4 +0,0 @@
#!/bin/bash
cd /usr/local/src/qchat
exec python2 ./run.py -C /etc/inspircd/certs/cert.pem -k /etc/inspircd/certs/key.pem

25
IRC/qchat.bash

@ -1,25 +0,0 @@
#!/bin/bash
pacman -Sy python2 python2-twisted python2-zope-interface python2-pyopenssl --noconfirm
if [ $(pgrep -acf run.py) -eq 0 ]; then echo Qchat is currently in use; exit 1; fi
rm -Rf /usr/local/src/qchat
cd /usr/local/src/
# Thanks Xertion for the package
gunzip -c /usr/local/src/ConfigPackages/IRC/qchat.tar.gz | tar xvf -
cd qchat
cp config.py.example config.py
sed -i 's/irc.myserver.com/aninix.net/' config.py
sed -i 's#http://moo.com/#http://aninix.net/irc/#' config.py
sed -i 's#http://foo.foo.org/#https://aninix.net/irc/#' config.py
sed -i 's#FooNet#AniNIX#' config.py
sed -i 's#moo@moo.com#noreply@aninix.net#' config.py
sed -i 's/#WEBIRC_PASSWORD = "fish"/WEBIRC_PASSWORD = "qchatbasedauthonly"/' config.py
sed -i 's/#SSLPORT/SSLPORT/' config.py
sed -i 's/WEBIRC_MODE = None/WEBIRC_MODE = "webirc"/g' config.py
sed -i 's/AUTH_SERVICE = "NickServ!services@rizon.net"/AUTH_SERVICE = "NickServ!ircservices@aninix.net"/' config.py
sed -i 's/NICK_SERVICE = "NickServ@services.rizon.net"/NICK_SERVICE = "NickServ@ircservices.aninix.net"/' config.py
sed -i 's#hue, 70, 60#hue, 70, 90#' js/ui/colour.js
cp /usr/local/src/ConfigPackages/IRC/dialogs.css css/dialogs.mcss
cp /usr/local/src/ConfigPackages/IRC/qui.mcss css/qui.mcss
python2 compile.py
chown -R ircd:ircd .

BIN
IRC/qchat.tar.gz

Binary file not shown.

298
IRC/qui.mcss

@ -1,298 +0,0 @@
topic_background=c,000000
lines_background=c,000000
topic_border=c,c8d2dc
tabbar_border=c,c3cee0
tabbar_background=c,000000
tabbar_text=c,000000
tab_border=c,c8d2dc
tab_text=c,FFFFFF
tab_hover=c,000000
tab_selected=c,000000
tab_selected_border=c,c8d2dc
tab_selected_text=c,333333
input_border=c,000000
nicklist_border=c,c8d2dc
nicklist_background=c,000000
nicklist_text=c,FFFFFF
nicklist_selected_border=c,c8d2dc
menu_border=c,c8d2dc
menu_background=c,000000
menu_hover_background=c,000000
lastpositionbar=c,FF0000
timestamp_display=o,SHOW_TIMESTAMPS,inline,none
timestamp_padding_left=o,SHOW_TIMESTAMPS,7px,11px
timestamp_text_indent=o,SHOW_TIMESTAMPS,-7px,-9px
html {
overflow: hidden;
}
#ircui {
position: absolute;
left: 0px;
right: 0px;
top: 0px;
height: 100%;
width: 100%;
overflow: hidden;
}
.qwebirc-qui .dynamicpanel {
position: absolute;
}
.qwebirc-qui .widepanel, .leftboundpanel {
left: 0px;
}
.qwebirc-qui .widepanel {
width: 100%;
}
.qwebirc-qui .topboundpanel {
top: 0px;
}
.qwebirc-qui .rightboundpanel {
/*right: 0px;*/
}
.qwebirc-qui .bottomboundpanel {
color: red;
}
.qwebirc-qui .lines {
color: WHITE;
overflow: auto;
background: $(lines_background);
}
.qwebirc-qui .lines .timestamp {
display: $(timestamp_display);
}
.qwebirc-qui .ircwindow div {
font-family: Consolas, "Lucida Console", monospace;
text-indent: $(timestamp_text_indent);
padding-left: $(timestamp_padding_left);
word-wrap: break-word;
}
.qwebirc-qui .tab-invisible {
display: none;
}
.qwebirc-qui .input input.keyboard-input {
border: 3px red solid;
margin: 2px 0px 0px 0px;
font-size: 1.3em;
width: 99%;
}
.qwebirc-qui .input input.mobile-input {
border: 0px;
margin: 2px 0px 0px 0px;
}
.qwebirc-qui .input input.mobile-button {
position: absolute;
top: 0px;
}
.qwebirc-qui form {
margin: 0px;
padding: 0px;
}
.qwebirc-qui .topic {
position: absolute;
left: 0px;
top: 0px;
right: 0px;
background-color: $(topic_background);
border-bottom: 1px dashed $(topic_border);
}
.qwebirc-qui .topic .emptytopic {
color: RED;
}
.qwebirc-qui .topic {
color: gray;
padding-left: 5px;
font-size: 0.7em;
cursor: default;
}
.qwebirc-qui .outertabbar {
border-bottom: 1px solid $(tabbar_border);
background: $(tabbar_background);
}
.qwebirc-qui .tabbar {
font-size: 0.8em;
color: $(tabbar_text);
margin-left: 38px;
line-height: 24px;
}
.qwebirc-qui a.tab {
border: 1px solid $(tab_border);
padding: 2px;
cursor: default;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
margin-right: -2px;
white-space: nowrap;
text-decoration: none;
color: $(tab_text);
}
.qwebirc-qui .tab:hover {
background: $(tab_hover);
border: 1px solid #c8d2dc;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
}
.qwebirc-qui .tab-selected {
background: $(tab_selected);
border: 1px solid $(tab_selected_border);
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
color: $(tab_selected_text);
}
.qwebirc-qui div.input {
border-top: 1px solid $(input_border);
padding-left: 3px;
padding-right: 3px;
}
.qwebirc-qui .tabclose {
margin-left: 5px;
font-size: 0.7em;
line-height: 150%;
vertical-align: top;
padding-left: 3px;
-moz-border-radius: 2px;
-webkit-border-radius: 2px;
border-radius: 2px;
}
.qwebirc-qui a.tab-hilight-activity {
color: #009900;
}
.qwebirc-qui a.tab-hilight-speech {
color: #0000ff;
}
.qwebirc-qui a.tab-hilight-us {
color: #ff0000;
}
.qwebirc-qui .nicklist {
border-left: 1px solid $(nicklist_border);
position: absolute;
top: 0px;
right: 0px;
width: 140px;
overflow: auto;
background: $(nicklist_background);
color: $(nicklist_text);
font-size: 0.7em;
}
.qwebirc-qui .nicklist a {
display: block;
color: WHITE;
text-decoration: none;
cursor: default;
border-top: 1px solid $(nicklist_background);
border-bottom: 1px solid $(nicklist_background);
padding-left: 1px;
}
.qwebirc-qui .nicklist a.selected {
display: block;
color: WHITE;
background: BLACK;
text-decoration: none;
border-bottom: $(nicklist_selected_border) 1px solid;
cursor: default;
}
.qwebirc-qui .nicklist a.selected-middle {
border-top: $(nicklist_selected_border) 1px solid;
}
div#noscript {
text-align: center;
font-weight: bold;
}
.qwebirc-qui .nicklist div.menu {
margin: 0px 0px 0px 5px;
}
.qwebirc-qui .nicklist div.menu a {
border-bottom: 0;
border-top: 0;
}
.qwebirc-qui .hyperlink-whois, .hyperlink-qwhois, .hyperlink-channel {
cursor: pointer;
cursor: hand;
}
.qwebirc-qui .hyperlink-whois:hover, .hyperlink-qwhois:hover, .hyperlink-channel:hover {
text-decoration: underline;
}
.qwebirc-qui .outertabbar .dropdown-tab {
cursor: pointer;
cursor: hand;
float: left;
padding: 4px;
width: 30px;
}
.qwebirc-qui .dropdownmenu {
z-index: 100;
border: 1px solid $(menu_border);
position: relative;
top: 10px;
left: 10px;
background: $(menu_background);
}
.qwebirc-qui .dropdownmenu a {
display: block;
font-size: 0.7em;
color: WHITE;
cursor: pointer;
cursor: hand;
padding-top: 1px;
padding-left: 3px;
padding-bottom: 1px;
padding-right: 3px;
}
.qwebirc-qui .dropdownmenu a:hover {
background: $(menu_hover_background); /* IE is rubbish and doesn't like #FFFFFF or white */
}
.qwebirc-qui .dropdownhint {
position: relative;
left: -500px;
z-index: 10;
white-space: nowrap;
font-size: 0.7em;
}
.qwebirc-qui hr.lastpos {
border: none;
border-top: 1px solid $(lastpositionbar);
margin-left: 3em;
margin-right: 3em;
}

59
Sharingan/Makefile

@ -0,0 +1,59 @@
INSTALLER != curl -s https://aninix.net/foundation/installer-test.bash | /bin/bash
compile:
# Install packages.
${INSTALLER} lighttpd php monitoring-plugins
# Nagios itself is AUR
if [ ! -d /usr/local/src/nagios ]; then git -C /usr/local/src clone https://aur.archlinux.org/nagios.git;
cd /usr/local/src/nagios
git pull
sudo -u '#1001' makepkg -sri
# Set up Lighttpd
mkdir -p /etc/lighttpd/conf.d
if [ `grep -c conf.d /etc/lighttpd/lighttpd.conf` -lt 1 ]; then echo 'include "conf.d/*.conf"' >> /etc/lighttpd/lighttpd.conf
# Setup PHP
if [ `grep -c /usr/share/nagios /etc/php/php.ini` -lt 1 ] then echo 'open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps:/etc/webapps:/usr/share/nagios' >> /etc/php/php.ini; fi
install: compile
sed '/^Description=/c\Description=AniNIX::Sharingan Monitoring (Nagios)' /usr/lib/systemd/system/nagios.serivce > /usr/lib/systemd/system/sharingan.service
rsync -avzl ./nagios.d/ /etc/nagios/
cp ./sharingan.conf /etc/lighttpd/conf.d/
make checkperm
systemctl daemon-reload
systemctl disable nagios.service
systemctl enable sharingan.service
systemctl start sharingan
systemctl enable lighttpd
systemctl start lighttpd
clean:
@echo Nothing to do
uninstall: /etc/nagios
pacman -R nagios monitoring-plugins
rm /etc/lighttpd/conf.d/sharingan*.conf
diff: /etc/nagios/ ./nagios.d
if [ -d /etc/nagios ]; then diff -rl ./nagios.d /etc/nagios; fi
if [ -f /etc/lighttpd/conf.d/sharingan.conf ]; then diff /etc/lighttpd/conf.d/sharingan.conf ./sharingan.conf; fi
if [ -f /etc/lighttpd/conf.d/sharingan-proxy.conf ]; then diff /etc/lighttpd/conf.d/sharingan-proxy.conf sharingan-proxy.conf; fi
reverse:
if [ -d /etc/nagios ]; then rsync -avzl /etc/nagios/ ./nagios.d/; fi
if [ -f /etc/lighttpd/conf.d/sharingan.conf ]; then cp /etc/lighttpd/conf.d/sharingan.conf .; fi
if [ -f /etc/lighttpd/conf.d/sharingan-proxy.conf ]; then cp /etc/lighttpd/conf.d/sharingan-proxy.conf .; fi
checkperm: /etc/nagios
chown -R nagios: /etc/nagios
chmod 0700 /etc/nagios
nagiosuser:
useradd -m nagios
mkdir -p /home/nagios/.ssh
apt-get install monitoring-plugins
touch /home/nagios/.ssh/authorized_keys
chmod 0600 /home/nagios/.ssh/authorized_keys
chmod 0700 /home/nagios/.ssh
chmod 0755 /home/nagios
cat > /home/nagios/.ssh/authorized_keys

396
Sharingan/nagios.d/cgi.cfg

@ -0,0 +1,396 @@
#################################################################
#
# CGI.CFG - Sample CGI Configuration File for Nagios 4.3.4
#
#
#################################################################
# MAIN CONFIGURATION FILE
# This tells the CGIs where to find your main configuration file.
# The CGIs will read the main and host config files for any other
# data they might need.
main_config_file=/etc/nagios/nagios.cfg
# PHYSICAL HTML PATH
# This is the path where the HTML files for Nagios reside. This
# value is used to locate the logo images needed by the statusmap
# and statuswrl CGIs.
physical_html_path=/usr/share/nagios/share
# URL HTML PATH
# This is the path portion of the URL that corresponds to the
# physical location of the Nagios HTML files (as defined above).
# This value is used by the CGIs to locate the online documentation
# and graphics. If you access the Nagios pages with an URL like
# http://www.myhost.com/nagios, this value should be '/nagios'
# (without the quotes).
url_html_path=/sharingan
# CONTEXT-SENSITIVE HELP
# This option determines whether or not a context-sensitive
# help icon will be displayed for most of the CGIs.
# Values: 0 = disables context-sensitive help
# 1 = enables context-sensitive help
show_context_help=0
# PENDING STATES OPTION
# This option determines what states should be displayed in the web
# interface for hosts/services that have not yet been checked.
# Values: 0 = leave hosts/services that have not been check yet in their original state
# 1 = mark hosts/services that have not been checked yet as PENDING
use_pending_states=1
# AUTHENTICATION USAGE
# This option controls whether or not the CGIs will use any
# authentication when displaying host and service information, as
# well as committing commands to Nagios for processing.
#
# Read the HTML documentation to learn how the authorization works!
#
# NOTE: It is a really *bad* idea to disable authorization, unless
# you plan on removing the command CGI (cmd.cgi)! Failure to do
# so will leave you wide open to kiddies messing with Nagios and
# possibly hitting you with a denial of service attack by filling up
# your drive by continuously writing to your command file!
#
# Setting this value to 0 will cause the CGIs to *not* use
# authentication (bad idea), while any other value will make them
# use the authentication functions (the default).
use_authentication=0
# x509 CERT AUTHENTICATION
# When enabled, this option allows you to use x509 cert (SSL)
# authentication in the CGIs. This is an advanced option and should
# not be enabled unless you know what you're doing.
use_ssl_authentication=0
# DEFAULT USER
# Setting this variable will define a default user name that can
# access pages without authentication. This allows people within a
# secure domain (i.e., behind a firewall) to see the current status
# without authenticating. You may want to use this to avoid basic
# authentication if you are not using a secure server since basic
# authentication transmits passwords in the clear.
#
# Important: Do not define a default username unless you are
# running a secure web server and are sure that everyone who has
# access to the CGIs has been authenticated in some manner! If you
# define this variable, anyone who has not authenticated to the web
# server will inherit all rights you assign to this user!
#default_user_name=guest
# SYSTEM/PROCESS INFORMATION ACCESS
# This option is a comma-delimited list of all usernames that
# have access to viewing the Nagios process information as
# provided by the Extended Information CGI (extinfo.cgi). By
# default, *no one* has access to this unless you choose to
# not use authorization. You may use an asterisk (*) to
# authorize any user who has authenticated to the web server.
authorized_for_system_information=nagiosadmin
# CONFIGURATION INFORMATION ACCESS
# This option is a comma-delimited list of all usernames that
# can view ALL configuration information (hosts, commands, etc).
# By default, users can only view configuration information
# for the hosts and services they are contacts for. You may use
# an asterisk (*) to authorize any user who has authenticated
# to the web server.
authorized_for_configuration_information=nagiosadmin
# SYSTEM/PROCESS COMMAND ACCESS
# This option is a comma-delimited list of all usernames that
# can issue shutdown and restart commands to Nagios via the
# command CGI (cmd.cgi). Users in this list can also change
# the program mode to active or standby. By default, *no one*
# has access to this unless you choose to not use authorization.
# You may use an asterisk (*) to authorize any user who has
# authenticated to the web server.
authorized_for_system_commands=nagiosadmin
# GLOBAL HOST/SERVICE VIEW ACCESS
# These two options are comma-delimited lists of all usernames that
# can view information for all hosts and services that are being
# monitored. By default, users can only view information
# for hosts or services that they are contacts for (unless you
# you choose to not use authorization). You may use an asterisk (*)
# to authorize any user who has authenticated to the web server.
authorized_for_all_services=nagiosadmin
authorized_for_all_hosts=nagiosadmin
# GLOBAL HOST/SERVICE COMMAND ACCESS
# These two options are comma-delimited lists of all usernames that
# can issue host or service related commands via the command
# CGI (cmd.cgi) for all hosts and services that are being monitored.
# By default, users can only issue commands for hosts or services
# that they are contacts for (unless you you choose to not use
# authorization). You may use an asterisk (*) to authorize any
# user who has authenticated to the web server.
authorized_for_all_service_commands=nagiosadmin
authorized_for_all_host_commands=nagiosadmin
# READ-ONLY USERS
# A comma-delimited list of usernames that have read-only rights in
# the CGIs. This will block any service or host commands normally shown
# on the extinfo CGI pages. It will also block comments from being shown
# to read-only users.
#authorized_for_read_only=user1,user2
# STATUSMAP BACKGROUND IMAGE
# This option allows you to specify an image to be used as a
# background in the statusmap CGI. It is assumed that the image
# resides in the HTML images path (i.e. /usr/local/nagios/share/images).
# This path is automatically determined by appending "/images"
# to the path specified by the 'physical_html_path' directive.
# Note: The image file may be in GIF, PNG, JPEG, or GD2 format.
# However, I recommend that you convert your image to GD2 format
# (uncompressed) but ONLY IF YOU WILL USE THE LEGACY MAP EXCLUSIVELY,
# as this will cause less CPU load when the CGI generates the image.
#statusmap_background_image=smbackground.gd2
# STATUSMAP TRANSPARENCY INDEX COLOR
# These options set the r,g,b values of the background color used the statusmap CGI,
# so normal browsers that can't show real png transparency set the desired color as
# a background color instead (to make it look pretty).
# Defaults to white: (R,G,B) = (255,255,255).
#color_transparency_index_r=255
#color_transparency_index_g=255
#color_transparency_index_b=255
# DEFAULT STATUSMAP LAYOUT METHOD
# This option allows you to specify the default layout method
# the statusmap CGI should use for drawing hosts. If you do
# not use this option, the default for the legacy map is to use
# user-defined coordinates and the default for the new map is "6"
# (Circular Balloon).
# Valid options for the legacy map are as follows:
# 0 = User-defined coordinates
# 1 = Depth layers
# 2 = Collapsed tree
# 3 = Balanced tree
# 4 = Circular
# 5 = Circular (Marked Up)
# Valid options for the new map are as follows:
# 0 = User-defined coordinates
# 1 = Depth Layers (Horizontal)
# 2 = Collapsed tree (Horizontal)
# 3 = Balanced tree (Horizontal)
# 4 = DON'T USE
# 5 = Circular Markup
# 6 = Circular Balloon
# 7 = Balanced tree (Vertical)
# 8 = Collapsed tree (Vertical)
# 9 = Depth Layers (Vertical)
# 10 = Force Map
#default_statusmap_layout=6
# DEFAULT STATUSWRL LAYOUT METHOD
# This option allows you to specify the default layout method
# the statuswrl (VRML) CGI should use for drawing hosts. If you
# do not use this option, the default is to use user-defined
# coordinates. Valid options are as follows:
# 0 = User-defined coordinates
# 2 = Collapsed tree
# 3 = Balanced tree
# 4 = Circular
default_statuswrl_layout=4
# STATUSWRL INCLUDE
# This option allows you to include your own objects in the
# generated VRML world. It is assumed that the file
# resides in the HTML path (i.e. /usr/local/nagios/share).
#statuswrl_include=myworld.wrl
# PING SYNTAX
# This option determines what syntax should be used when
# attempting to ping a host from the WAP interface (using
# the statuswml CGI. You must include the full path to
# the ping binary, along with all required options. The
# $HOSTADDRESS$ macro is substituted with the address of
# the host before the command is executed.
# Please note that the syntax for the ping binary is
# notorious for being different on virtually ever *NIX
# OS and distribution, so you may have to tweak this to
# work on your system.
ping_syntax=/bin/ping -n -U -c 5 $HOSTADDRESS$
# REFRESH RATE
# This option allows you to specify the refresh rate in seconds
# of various CGIs (status, statusmap, extinfo, and outages).
refresh_rate=90
# DEFAULT PAGE LIMIT
# This option allows you to specify the default number of results
# displayed on the status.cgi. This number can be adjusted from
# within the UI after the initial page load. Setting this to 0
# will show all results.
result_limit=100
# ESCAPE HTML TAGS
# This option determines whether HTML tags in host and service
# status output is escaped in the web interface. If enabled,
# your plugin output will not be able to contain clickable links.
escape_html_tags=1
# SOUND OPTIONS
# These options allow you to specify an optional audio file
# that should be played in your browser window when there are
# problems on the network. The audio files are used only in
# the status CGI. Only the sound for the most critical problem
# will be played. Order of importance (higher to lower) is as
# follows: unreachable hosts, down hosts, critical services,
# warning services, and unknown services. If there are no
# visible problems, the sound file optionally specified by
# 'normal_sound' variable will be played.
#
#
# <varname>=<sound_file>
#
# Note: All audio files must be placed in the /media subdirectory
# under the HTML path (i.e. /usr/local/nagios/share/media/).
#host_unreachable_sound=hostdown.wav
#host_down_sound=hostdown.wav
#service_critical_sound=critical.wav
#service_warning_sound=warning.wav
#service_unknown_sound=warning.wav
#normal_sound=noproblem.wav
# URL TARGET FRAMES
# These options determine the target frames in which notes and
# action URLs will open.
action_url_target=_blank
notes_url_target=_blank
# LOCK AUTHOR NAMES OPTION
# This option determines whether users can change the author name
# when submitting comments, scheduling downtime. If disabled, the
# author names will be locked into their contact name, as defined in Nagios.
# Values: 0 = allow editing author names
# 1 = lock author names (disallow editing)
lock_author_names=1
# SPLUNK INTEGRATION OPTIONS
# These options allow you to enable integration with Splunk
# in the web interface. If enabled, you'll be presented with
# "Splunk It" links in various places in the CGIs (log file,
# alert history, host/service detail, etc). Useful if you're
# trying to research why a particular problem occurred.
# For more information on Splunk, visit http://www.splunk.com/
# This option determines whether the Splunk integration is enabled
# Values: 0 = disable Splunk integration
# 1 = enable Splunk integration
#enable_splunk_integration=1
# This option should be the URL used to access your instance of Splunk
#splunk_url=http://127.0.0.1:8000/
# NAVIGATION BAR SEARCH OPTIONS
# The following options allow to configure the navbar search. Default
# is to search for hostnames. With enabled navbar_search_for_addresses,
# the navbar search queries IP addresses as well. It's also possible
# to enable search for aliases by setting navbar_search_for_aliases=1.
navbar_search_for_addresses=1
navbar_search_for_aliases=1
# DEFAULTS FOR CHECKBOXES FOR ACKNOWLEDGEMENTS
# Enabling ack_no_sticky will default the "Sticky Acknowledgement" to
# be unchecked.
# Enabling ack_no_send will default the "Send Notification" to
# be unchecked.
#ack_no_sticky=0
#ack_no_send=0
# SHOW ONLY HARD STATES IS TACTICAL OVERVIEW
# This option controls whether only HARD states are counted on the
# Tactical Overview, or if both HARD and SOFT states are counted.
# Set to 1 to show only HARD states. Defaults to 0 (HARD+SOFT).
#tac_cgi_hard_only=0

312
Sharingan/nagios.d/daemon-init

@ -0,0 +1,312 @@
#!/bin/sh
#
# chkconfig: 345 99 01
# description: Nagios network monitor
# processname: nagios
# File : nagios
#
# Author : Jorge Sanchez Aymar (jsanchez@lanchile.cl)
#
# Changelog :
#
# 1999-07-09 Karl DeBisschop <kdebisschop@infoplease.com>
# - setup for autoconf
# - add reload function
# 1999-08-06 Ethan Galstad <egalstad@nagios.org>
# - Added configuration info for use with RedHat's chkconfig tool
# per Fran Boon's suggestion
# 1999-08-13 Jim Popovitch <jimpop@rocketship.com>
# - added variable for nagios/var directory
# - cd into nagios/var directory before creating tmp files on startup
# 1999-08-16 Ethan Galstad <egalstad@nagios.org>
# - Added test for rc.d directory as suggested by Karl DeBisschop
# 2000-07-23 Karl DeBisschop <kdebisschop@users.sourceforge.net>
# - Clean out redhat macros and other dependencies
# 2003-01-11 Ethan Galstad <egalstad@nagios.org>
# - Updated su syntax (Gary Miller)
#
# Description: Starts and stops the Nagios monitor
# used to provide network services status.
#
### BEGIN INIT INFO
# Provides: nagios
# Required-Start: $local_fs $syslog $network
# Required-Stop: $local_fs $syslog $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Starts and stops the Nagios monitoring server
# Description: Starts and stops the Nagios monitoring server
### END INIT INFO
# Our install-time configuration.
prefix=/usr/share/nagios
exec_prefix=${prefix}
NagiosBin=/usr/bin/nagios
NagiosCfgFile=/etc/nagios/nagios.cfg
NagiosCfgtestFile=/var/nagios/nagios.configtest
NagiosStatusFile=/var/nagios/status.dat
NagiosRetentionFile=/var/nagios/retention.dat
NagiosCommandFile=/var/nagios/rw/nagios.cmd
NagiosVarDir=/var/nagios
NagiosRunFile=/run/nagios.lock
NagiosLockDir=/var/lock/subsys
NagiosLockFile=nagios
NagiosCGIDir=${exec_prefix}/sbin
NagiosUser=30
NagiosGroup=30
checkconfig="true"
# Source function library
# Some *nix do not have an rc.d directory, so do a test first
if [ -f /etc/rc.d/init.d/functions ]; then
. /etc/rc.d/init.d/functions
elif [ -f /etc/init.d/functions ]; then
. /etc/init.d/functions
elif [ -f /lib/lsb/init-functions ]; then
. /lib/lsb/init-functions
fi
# Load any extra environment variables for Nagios and its plugins.
if test -f /etc/sysconfig/nagios; then
. /etc/sysconfig/nagios
fi
# Automate addition of RAMDISK based on environment variables
USE_RAMDISK=${USE_RAMDISK:-0}
if test "$USE_RAMDISK" -ne 0 && test "$RAMDISK_SIZE"X != "X"; then
ramdisk=`mount |grep "${RAMDISK_DIR} type tmpfs"`
if [ "$ramdisk"X == "X" ]; then
mkdir -p -m 0755 ${RAMDISK_DIR}
mount -t tmpfs -o size=${RAMDISK_SIZE}m tmpfs ${RAMDISK_DIR}
mkdir -p -m 0755 ${RAMDISK_DIR}/checkresults
chown -h -R $NagiosUser:$NagiosGroup ${RAMDISK_DIR}
fi
fi
check_config ()
{
rm -f "$NagiosCfgtestFile";
if test -e "$NagiosCfgtestFile"; then
echo "ERROR: Could not delete '$NagiosCfgtestFile'"
exit 8
fi
if ! su $NagiosUser -c "touch $NagiosCfgtestFile"; then
echo "ERROR: Could not create or update '$NagiosCfgtestFile'"
exit 8
fi
TMPFILE=$(mktemp /tmp/.configtest.XXXXXXXX)
$NagiosBin -vp $NagiosCfgFile > "$TMPFILE"
WARN=`grep ^"Total Warnings:" "$TMPFILE" |awk -F: '{print \$2}' |sed s/' '//g`
ERR=`grep ^"Total Errors:" "$TMPFILE" |awk -F: '{print \$2}' |sed s/' '//g`
if test "$WARN" = "0" && test "${ERR}" = "0"; then
echo "OK - Configuration check verified" > $NagiosCfgtestFile
/bin/rm "$TMPFILE"
return 0
elif test "${ERR}" = "0"; then
# Write the errors to a file we can have a script watching for.
echo "WARNING: Warnings in config files - see log for details: $NagiosCfgtestFile" > $NagiosCfgtestFile
egrep -i "(^warning|^error)" "$TMPFILE" >> $NagiosCfgtestFile
/bin/rm "$TMPFILE"
return 0
else
# Write the errors to a file we can have a script watching for.
echo "ERROR: Errors in config files - see log for details: $NagiosCfgtestFile" > $NagiosCfgtestFile
egrep -i "(^warning|^error)" "$TMPFILE" >> $NagiosCfgtestFile
cat "$TMPFILE"
exit 8
fi
}
status_nagios ()
{
if test -x $NagiosCGI/daemonchk.cgi; then
if $NagiosCGI/daemonchk.cgi -l $NagiosRunFile > /dev/null 2>&1; then return 0; fi
else
if ps -p $NagiosPID > /dev/null 2>&1; then return 0; fi
fi
return 1
}
printstatus_nagios ()
{
if status_nagios; then
echo "nagios (pid $NagiosPID) is running..."
else
echo "nagios is not running"
fi
}
killproc_nagios ()
{
kill -s "$1" $NagiosPID
}
pid_nagios ()
{
if test ! -f $NagiosRunFile; then
echo "No lock file found in $NagiosRunFile"
exit 1
fi
NagiosPID=`head -n 1 $NagiosRunFile`
}
remove_commandfile ()
{
# Removing a stalled command file, while there are processes trying/waiting to write into it,
# will deadlock those processes in a blocking open() system call. To allow such processes to
# die on a broken pipe, the pipe must be opened for reading without actually reading from it,
# which is what dd does here. To avoid a chicken-egg problem, the pipe is renamed beforehand.
# In order for the dd to not deadlock when there is no writing process, it is executed in the
# background in a subshell together with an empty echo to have at least one writing process.
# see http://unix.stackexchange.com/questions/335406/opening-named-pipe-blocks-forever-if-pipe-is-deleted-without-being-connected
if [ -p $NagiosCommandFile ]; then
mv -f $NagiosCommandFile $NagiosCommandFile~
(dd if=$NagiosCommandFile~ count=0 2>/dev/null & echo -n "" >$NagiosCommandFile~)
fi
rm -f $NagiosCommandFile $NagiosCommandFile~
}
# Check that nagios exists.
if [ ! -f $NagiosBin ]; then
echo "Executable file $NagiosBin not found. Exiting."
exit 1
fi
# Check that nagios.cfg exists.
if [ ! -f $NagiosCfgFile ]; then
echo "Configuration file $NagiosCfgFile not found. Exiting."
exit 1
fi
# See how we were called.
case "$1" in
start)
echo -n "Starting nagios:"
if test "$checkconfig" = "true"; then
check_config
# check_config exits on configuration errors.
fi
if test -f $NagiosRunFile; then
NagiosPID=`head -n 1 $NagiosRunFile`
if status_nagios; then
echo " another instance of nagios is already running."
exit 0
fi
fi
su $NagiosUser -c "touch $NagiosVarDir/nagios.log $NagiosRetentionFile"
remove_commandfile
touch $NagiosRunFile
$NagiosBin -d $NagiosCfgFile
if [ -d $NagiosLockDir ]; then touch $NagiosLockDir/$NagiosLockFile; fi
echo " done."
;;
stop)
echo -n "Stopping nagios:"
pid_nagios
killproc_nagios TERM
# now we have to wait for nagios to exit and remove its
# own NagiosRunFile, otherwise a following "start" could
# happen, and then the exiting nagios will remove the
# new NagiosRunFile, allowing multiple nagios daemons
# to (sooner or later) run - John Sellens
#echo -n 'Waiting for nagios to exit .'
for i in {1..90}; do
if status_nagios > /dev/null; then
echo -n '.'
sleep 1
else
break
fi
done
if status_nagios > /dev/null; then
echo ''
echo 'Warning - nagios did not exit in a timely manner - Killing it!'
killproc_nagios KILL
else
echo ' done.'
fi
remove_commandfile
rm -f $NagiosStatusFile $NagiosRunFile $NagiosLockDir/$NagiosLockFile
;;
status)
pid_nagios
printstatus_nagios
;;
checkconfig)
if test "$checkconfig" = "true"; then
printf "Running configuration check...\n"
check_config
fi
if [ $? -eq 0 ]; then
echo " OK."
else
echo " CONFIG ERROR! Check your Nagios configuration."
exit 1
fi
;;
restart)
if test "$checkconfig" = "true"; then
printf "Running configuration check...\n"
check_config
fi
$0 stop
$0 start
;;
reload|force-reload)
if test "$checkconfig" = "true"; then
printf "Running configuration check...\n"
check_config
fi
if test ! -f $NagiosRunFile; then
$0 start
else
pid_nagios
if status_nagios > /dev/null; then
printf "Reloading nagios configuration...\n"
killproc_nagios HUP
echo "done"
else
$0 stop
$0 start
fi
fi
;;
configtest)
$NagiosBin -vp $NagiosCfgFile
;;
*)
echo "Usage: nagios {start|stop|restart|reload|force-reload|status|checkconfig|configtest}"
exit 1
;;
esac
# End of this script

34
Sharingan/nagios.d/groups/hostgroups.cfg

@ -0,0 +1,34 @@
# Define a hostgroup for Windows machines
# All hosts that use the windows-server template will automatically be a member of this group
define hostgroup{
hostgroup_name windows-servers ; The name of the hostgroup
alias Windows Servers ; Long name of the group
}
# Define a hostgroup for Linux machines
# All hosts that use the linux-server template will automatically be a member of this group
define hostgroup{
hostgroup_name linux-servers ; The name of the hostgroup
alias Linux Servers ; Long name of the group
}
define hostgroup{
hostgroup_name geth
alias Geth Hardware
members geth-hub-1,geth-hub-2,geth-hub-3,armature
}
define hostgroup{
hostgroup_name critical
alias Critical
members core,shadowfeed,hypervisor
}
define hostgroup{
hostgroup_name servicemachines
alias Service Machines
members darknet,bastion,sharingan,print
}

39
Sharingan/nagios.d/hosts/armature.cfg

@ -0,0 +1,39 @@
define host{
use linux-server ; Name of host template to use
host_name armature
alias armature
address 10.0.1.57
check_period workhours
notes_url https://aninix.net/wiki/Geth/Hardware
}
###############################################################################
###############################################################################
#
# SERVICE DEFINITIONS
#
###############################################################################
###############################################################################
# Define a service to "ping" the local machine
define service{
use local-service ; Name of service template to use
host_name armature
service_description PING
check_command check_ping!100.0,20%!500.0,60%
}
define service{
use local-service ; Name of service template to use
host_name armature
service_description Telnet
check_command check_tcp!23
#notifications_enabled 0
}

101
Sharingan/nagios.d/hosts/bastion.cfg

@ -0,0 +1,101 @@
define host{
use linux-server ; Name of host template to use
host_name bastion
alias bastion
notes_url https://aninix.net/wiki/Bastion
address 10.0.1.5
}
###############################################################################
###############################################################################
#
# SERVICE DEFINITIONS
#
###############################################################################
###############################################################################
# Define a service to "ping" the local machine
define service{
use local-service ; Name of service template to use
host_name bastion
service_description PING
check_command check_ping!100.0,20%!500.0,60%
}
# Define a service to check the disk space of the root partition
# on the local machine. Warning if < 20% free, critical if
# < 10% free space on partition.
define service{
use local-service ; Name of service template to use
host_name bastion
service_description Root Partition
check_command check_remote_disk!20%!10%!/
}
# Define a service to check the number of currently logged in
# users on the local machine. Warning if > 20 users, critical
# if > 50 users.
define service{
use local-service ; Name of service template to use
host_name bastion
service_description Current Users
check_command check_remote_users!20!50
}
# Define a service to check the number of currently running procs
# on the local machine. Warning if > 250 processes, critical if
# > 400 processes.
define service{
use local-service ; Name of service template to use
host_name bastion
service_description Total Processes
check_command check_remote_procs!250!400!RSZDT
}
# Define a service to check the load on the local machine.
define service{
use local-service ; Name of service template to use
host_name bastion
service_description Current Load
check_command check_remote_load!5.0,4.0,3.0!10.0,6.0,4.0
}
# Define a service to check SSH on the local machine.
# Disable notifications for this service by default, as not all users may have SSH enabled.
define service{
use local-service ; Name of service template to use
host_name bastion
service_description SSH
notes_url https://aninix.net/wiki/SSH
check_command check_ssh
#notifications_enabled 0
}
define service {
use local-service
host_name bastion
service_description FoldingAtHome
check_command check_by_ssh!'[[ `pgrep -afc FAHclient` -lt 3 ]]'
#notifications_enabled 1
}

277
Sharingan/nagios.d/hosts/core.cfg

@ -0,0 +1,277 @@
define host{
use linux-server ; Name of host template to use
host_name core
notes_url https://aninix.net/wiki/Core
alias core
address 10.0.1.3
}
###############################################################################
###############################################################################
#
# SERVICE DEFINITIONS
#
###############################################################################
###############################################################################
# Define a service to "ping" the local machine
define service{
use local-service ; Name of service template to use
host_name core
service_description PING
check_command check_ping!100.0,20%!500.0,60%
}
# Define a service to check the disk space of the root partition
# on the local machine. Warning if < 20% free, critical if
# < 10% free space on partition.
define service{
use local-service ; Name of service template to use
host_name core
service_description Root Partition
check_command check_remote_disk!10%!5%!/
}
# Define a service to check the number of currently logged in
# users on the local machine. Warning if > 20 users, critical
# if > 50 users.
define service{
use local-service ; Name of service template to use
host_name core
service_description Current Users
check_command check_remote_users!20!50
}
# Define a service to check the number of currently running procs
# on the local machine. Warning if > 250 processes, critical if
# > 400 processes.
define service{
use local-service ; Name of service template to use
host_name core