Berryterminal: Raspberry Pi as LTSP client
- Read more about Berryterminal: Raspberry Pi as LTSP client
- Log in to post comments
# NOTE:
# Good news: connection to LTSP server works fine.
# NOTE:
# Good news: connection to LTSP server works fine.
# basic plugins
apt-get install -y nagios-plugins-basic
# memory
wget -q --no-check-certificate https://raw.githubusercontent.com/panticz/icinga/master/plugins/scripts/check_mem.sh -O - | bash -
# hddtemp
https://raw.githubusercontent.com/panticz/icinga/master/plugins/scripts/check_hddtemp.sh
# ipmi
http://www.thomas-krenn.com/de/wiki/IPMI_Sensor_Monitoring_Plugin_Version_1.x
# sensors
http://www.panticz.de/lm-sensors
# automatic apt-update
# harddisc temperature (http://exchange.nagios.org/components/com_mtree/attachment.php?link_id=341&cf_id=24)
# add PPA
sudo add-apt-repository -y ppa:gwendal-lebihan-dev/cinnamon-stable
sudo apt-get update
# install cinnamon
sudo apt-get install -y cinnamon
# OPTIONAL: install nemo
sudo apt-get install -y nemo
# Links
http://wiki.ubuntuusers.de/Cinnamon
http://wiki.ubuntuusers.de/Paketquellen_freischalten/PPA#PPA-hinzufuegen
#
# graph (server)
# TODO: BROKEN with Icinga 1.7.1?
#
apt-get install -y pnp4nagios
sed -i 's|/cgi-bin/nagios3|/icinga/cgi-bin|g' /etc/pnp4nagios/config.php
sed -i 's|/etc/nagios3/htpasswd.users|/etc/icinga/htpasswd.users|g' /etc/pnp4nagios/apache.conf
sed -i 's|process_performance_data=0|process_performance_data=1|g' /etc/icinga/icinga.cfg
sed -i 's|#broker_module=/usr/lib/icinga/idomod.so config_file=/etc/icinga/idomod.cfg|broker_module=/usr/lib/pnp4nagios/npcdmod.o config_file=/etc/pnp4nagios/npcd.cfg|g' /etc/icinga/icinga.cfg
sed -i 's|log_type = syslog|log_type = file|g'
# icinga SSH on server
# run once
# /var/lib/nagios/.ssh/config
su -s /bin/bash nagios -c "ssh-keygen -q -f /var/lib/nagios/.ssh/id_rsa -N ''"
# run for every client
# TODO: automate, one command?
su -s /bin/bash nagios
ssh-copy-id root@192.168.1.222
ssh root@192.168.1.222
exit
# install on client
# apt-get install -y nagios-plugins
apt-get install -y nagios-plugins-basic
# apt-get install -y nagios-plugins-standard
# apt-get install -y nagios-plugins-contrib --no-install-recommends
chown root:root /usr/lib/nagios/plugins/check_ide_smart
chmod u+s /usr/lib/nagios/pl
Host
http://www.panticz.de/icinga-cbjects-debian_xen_host.cfg
VoIP phone
http://www.panticz.de/icinga-cbjects-sipphone1.cfg
# disable service
register 0
Examples
define serviceescalation {
host_name localhost
service_description HTTP
first_notification 5
contact_groups admins, managers
escalation_condition host linux=d | service linux.SSH=w,c
}
Snippets
# certificate check
define service {
use generic-service
host_name www.example.com
# on Icinga / Nagios client
apt-get install -y nagios-nrpe-server
sed -i 's|allowed_hosts=127.0.0.1|allowed_hosts=192.168.1.197|g' /etc/nagios/nrpe.cfg
/etc/init.d/nagios-nrpe-server restart
cat < /etc/nagios/nrpe.d/my.cfg
command[check_root]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /
command[check_http]=/usr/lib/nagios/plugins/check_http -H localhost
command[check_ssh]=/usr/lib/nagios/plugins/check_ssh localhost
EOF
/etc/init.d/nagios-nrpe-server restart
# test access
/usr/lib/nagios/plugins/check_nrpe -H
# on Icinga / Nagios server
apt-ge
<?php
$URL="https://raw.githubusercontent.com/panticz/installit/master/install.icinga.sh";
echo "wget $URL -O - | bash -";
echo "
"; $c = curl_init(); curl_setopt($c, CURLOPT_URL, $URL); curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); echo htmlspecialchars(curl_exec($c)); curl_close($c); echo "
";
?>
Admin login
http://YOUR_IP/icinga/
user: icingaadmin
pass: icingaadmin
Icinga Apache configuration
/etc/apache2/conf-available/icinga.conf
Icinga repository
http://packages.icinga.org/
Enable automatic updates
# http://www.panticz.de/debian-ubuntu-automatic-upgrades
wget -q --no-check-certificate https://raw.githubusercontent.com/panticz/scripts/master/enable_auto_update.sh -O - | bash -
configure contact
sed -i 's|root@localhost|YOUR@EMAIL-ADDRESS.com|g' /etc/icinga/objects/contacts_icinga.cfg
change password
htpasswd -c /etc/icinga/htpasswd.users icingaadmin
plugins
http://www.panticz.de/Icinga-plugins
LDAP
a2enmod authnz_ldap
echo "pass1234" > /etc/apache2/ldap_password.inc
chmod 600 /etc/apache2/ldap_password.inc
sed -i 's|=icingaadmin|=*|g' /etc/icinga/cgi.cfg
/etc/icinga/apache2.conf
- AuthUserFile /etc/icinga/htpasswd.users
+ AuthBasicProvider ldap
+ AuthLDAPBindDN "ldap@example.com"
+ AuthLDAPBindPassword "exec:/bin/cat /etc/apache2/ldap_password.inc"
+ AuthLDAPURL "ldap://ldap.example.com:3268/dc=example,dc=com?sAMAccountName?sub?(objectClass=*)" NONE
+ AuthLDAPRemoteUserIsDN off
+ Require ldap-group CN=IPG.DevOps,OU=_IntranetPermissionGroups,DC=example,DC=com
service apache2 restart
# config
https://wiki.icinga.org/display/Dev/Icinga+Core+Debug+Config
# cgi
http://docs.icinga.org/latest/de/cgiparams.html#cgiparams-ahas
http://icinga.example.com/cgi-bin/icinga/status.cgi?servicestatustypes=20&noheader=1
Links
http://www.debmon.org/ - Debian Monitoring Project
http://packages.debian.org/wheezy/icinga
http://packages.icinga.org/debian/ - Icinga repository
https://www.icinga.org/icinga2/ - Icinga 2 preview
http://www.sysadminslife.com/monitoring-2/icinga-1-9-installation-unter-debian-squeeze-wheezy-aktuellste-version/
Install Icinga master (server)
http://www.panticz.de/Install-icinga
Configure by ssh (minimalistic setup on clients)
http://www.panticz.de/Install-icinga-SSH-on-client
Templates
/etc/icinga/objects/generic-service_icinga.cfg
Check syntax
sudo /etc/init.d/icinga check
Check return codes
0 - OK
1 - warning
2 - critical
3 - unknown
Icons
wget http://cdn1.iconfinder.com/data/icons/fatcow/16x16/mail_yellow.png -O /usr/share/nagios/htdocs/images/logos/base/mail.png
http://wiki.ipfire.org/de/addons/net-snmp/start - SNMP Daemon for IpFire
Edit Cron jobs on IpFire
fcrontab -e
/etc/init.d/fcron restart
# force update dyndns every day
#9 2 * * 0 [ -f "/var/ipfire/red/active" ] && /usr/local/bin/setddns.pl -f
0 19 * * * [ -f "/var/ipfire/red/active" ] && /usr/local/bin/setddns.pl -f
Upgrade
pakfire update
pakfire upgrade
Install Addons
pakfire install -y iftop
Update XEN VM
mount /dev/vg1/fw-boot /mnt/
# add XEN boot entry in GRUB configuration