Fernseher über HDMI (CEC) per Raspberry PI steuern

Wie der begeisterte Bastler bestimmt schon gemerkt hat, kann man mit dem Raspberry PI so einige coole Geräte steuern.
So ist es vielleicht auch nützlich den Fernseher ansteuern zu können. Dafür braucht man generell kein Raspberry PI, sondern nur HDMI und ein CEC-fähigen Fernseher, Endgerät. CEC ist ein definiertes Steuerprotokoll, worüber sich Entertainment Geräte steuern lassen und so z.B. eingeschaltet, ausgeschaltet werden können.
Je nach Hersteller heißt das aber nicht immer CEC, sondern z.B. Anynet+ bei Samsung oder Bravia Theatre Sync bei Sony. Hier findet ihr noch einen ganz einfach geschrieben Artikel der CEC erklärt.
Mit der Software „cec-client“ könnt ihr unter einem Linux-Gerät euren Fernseher via HDMI steuern.
Ich beschreibe hier kurz die Installation und ein paar nützliche Befehle.
Schritt 1: Notwendige Abhängigkeiten installieren

sudo apt-get install autoconf build-essential git liblockdev1-dev libtool libudev-dev pkg-config 

Schritt 2: Quellcode herunterladen
Die Quellen für libcec bzw. cec-client sind offen verfügbar unter: https://github.com/Pulse-Eight/libcec.

git clone git://github.com/Pulse-Eight/libcec.git

Schritt 3: Konfigurieren

cd libcec/
./bootstrap
./configure --with-rpi-include-path=/opt/vc/include --with-rpi-lib-path=/opt/vc/lib --enable-rpi

Schritt 4: Kompilieren

make
sudo make install
sudo ldconfig

Schritt 5: Testen
Nun probieren wir aus, ob der cec-client denn funktioniert, er müsste den Raspberry PI erkennen.

pi@RPI ~ $ cec-client -l
Found devices: 1
device: 1
com port: RPI
vendor id: 2708
product id: 1001
firmware version: 1
type: Raspberry Pi

So und nun zum interessanten Teil: Fernseher per HDMI steuern.
Prüft ob an eurem Fernseher die HDMI-CEC Funktion eingeschaltet ist. Dies ist Standardmäßig nicht immer der Fall. In der Regel findet sich dies immer irgendwo unter Einstellungen -> System -> HDMI.
Fernseher per CEC-Client einschalten: 
Folgenden Befehl einfach über die Kommandozeile absetzen.

echo "on 0" | sudo cec-client -s -d 1

Das -s brauchen wir, damit der cec-client im „Single Command“ Mode arbeitet, und unseren Befehl per echo-pipe entgegen nimmt.
Das -d 1 setzt das Loglevel und sorgt für eine überschaubare Rückmeldung. Ihr könnt das ruhig mal weglassen und die komplette Ausgabe analysieren.
Fernseher per CEC-Client ausschalten:

echo "standby 0" | sudo cec-client -s -d 1

Power-Status per CEC-Client auslesen:

echo "pow 0" | sudo cec-client -s -d 1

Fernseher per CEC-Client auf HDMI1,HDMI2,HDMI3, usw. umschalten:

echo "tx 4F 82 10 00" | cec-client -s

Wofür das 4F steht weiß ich ehrlich gesagt nicht, die 82 steht für den „Active Source“ Befehl, die 10 ist bei meinem Sony Fernseher HDMI1, die 00 ist das Ziel als Broadcast.
Um auf HDMI4 umzuschalten wäre der Befehl also:

echo "tx 4F 82 40 00" | cec-client -s

Da muss man ein bisschen herumprobieren, kann je nach Fernseher etwas unterschiedlich sein.
Hilfreich kann folgende Seite sein: www.cec-o-matic.com, dort kann man sich die HDMI Befehle passend zusammenklicken.

Owncloud 7 mit Truecrypt verschlüsselung und SSL unter Ubuntu 14.04 installieren

logoDurch verschiedene „angebliche“ Hacks sind öffentliche Cloud-Dienstleister ja wieder einmal ordentlich in die Kritik gerückt worden. Aus diesem Grund erkläre ich hier, wie man seine eigene private Cloud unter einem Ubuntu Server installieren kann.
Die kostenfreie owncloud Software dient uns dafür als Basis für unsere Cloud. Zur Synchronisation von Dateien, Kontakten, Fotos, Kalendern etc. gibt es verschiedene Apps für Windows, Linux, Unix, Android und iOS.
Unsere Daten speichern wir in einem verschlüsseltem Truecrypt Container und können die einzelnen Dateien zusätzlich noch einmal per Server-Side-Encryption verschlüsseln.
Die beste Verschlüsselung hilft natürlich nichts, wenn man einfache Passwörter benutzt.
Die Installation von Owncloud 7 tätige ich auf einem Ubuntu Server 14.04 – das ganze funktioniert aber zum Beispiel auch mit einem Raspberry Pi!
Also Schritt 1: Truecrypt installieren über PPA:

add-apt-repository ppa:stefansundin/truecrypt
apt-get update && apt-get install truecrypt

Truecrypt Volume erstellen:

truecrypt –create

[EXPAND Truecrypt Container erstellung]
truecrypt –create
Volume type:
1) Normal
2) Hidden
Select [1]: 1
Enter volume path: /media/hdd1tb/container.tc
Enter volume size (sizeK/size[M]/sizeG): 300G
Encryption algorithm:
1) AES
2) Serpent
3) Twofish
4) AES-Twofish
5) AES-Twofish-Serpent
6) Serpent-AES
7) Serpent-Twofish-AES
8) Twofish-Serpent
Select [1]:
Hash algorithm:
1) RIPEMD-160
2) SHA-512
3) Whirlpool
Select [1]:
Filesystem:
1) None
2) FAT
3) Linux Ext2
4) Linux Ext3
5) Linux Ext4
Select [2]: 5
Enter password:
Re-enter password:
Enter keyfile path [none]:
Please type at least 320 randomly chosen characters and then press Enter
[/EXPAND]
Truecrypt Volume mounten:

truecrypt -m /media/hdd1tb/container.tc /media/data

Für Owncloud vorbereiten:

mkdir /media/data/oc
touch /media/data/oc/.ocdata
chown www-data:www-data /media/data/oc

Für die owncloud Installation gibt es 2 Möglichkeiten: Entweder via apt-get install owncloud oder manuell.
Ich beschreibe den manuellen weg, dass ist nicht umständlicher und man weiß besser was im Hintergrund passiert und was die Default-Pfade sind.
Manuelle Owncloud installation:
1. Notwendige Abhängigkeiten installieren:

sudo apt-get install apache2 mysql-server libapache2-mod-php5
sudo apt-get install php5-gd php5-json php5-mysql php5-curl
sudo apt-get install php5-intl php5-mcrypt php5-imagick phpmyadmin

Hinweis: Um alle Funktionen nutzen zu können, wird über apt vorgeschlagen die folgenden Pakete zusätzlich noch zu installieren. Ich würde dies erst einmal nicht machen, und nur dass installieren, was später auch wirklich benötigt wird.
[Expand weitere Abhängigkeiten]
ca-certificates-java dbus-x11 default-jre default-jre-headless
desktop-file-utils dictionaries-common fonts-dejavu fonts-dejavu-extra
fonts-font-awesome fonts-liberation fonts-opensymbol fonts-sil-gentium
fonts-sil-gentium-basic gconf-service gconf-service-backend gconf2
gconf2-common gdisk ghostscript gsfonts gvfs gvfs-common gvfs-daemons
gvfs-libs hunspell-en-us icedtea-7-jre-jamvm imagemagick-common java-common
libao-common libao4 libasound2 libasound2-data libasyncns0 libatasmart4
libatk-wrapper-java libatk-wrapper-java-jni libav-tools libavahi-glib1
libavcodec54 libavdevice53 libavfilter3 libavformat54 libavresample1
libavutil52 libbonobo2-0 libbonobo2-common libboost-date-time1.54.0
libboost-system1.54.0 libcaca0 libcanberra0 libcdio-cdda1 libcdio-paranoia1
libcdio13 libcdr-0.0-0 libclucene-contribs1 libclucene-core1 libcmis-0.4-4
libcolamd2.8.0 libcupsfilters1 libcupsimage2 libdc1394-22
libexttextcat-2.0-0 libexttextcat-data libfftw3-double3 libflac8 libfontenc1
libgconf-2-4 libgconf2-4 libgif4 libglu1-mesa libgnome2-0 libgnome2-bin
libgnome2-common libgnomevfs2-0 libgnomevfs2-common libgs9 libgs9-common
libgsm1 libgstreamer-plugins-base1.0-0 libgstreamer1.0-0 libharfbuzz-icu0
libhsqldb1.8.0-java libhunspell-1.3-0 libhyphen0 libicu52 libidl-common
libidl0 libijs-0.35 libjack-jackd2-0 libjbig2dec0 libjs-chosen
libjs-dojo-core libjs-dojo-dijit libjs-dojo-dojox libjs-jcrop
libjs-jquery-minicolors libjs-jquery-timepicker libjs-pdf libjs-sphinxdoc
libjs-twitter-bootstrap liblangtag-common liblangtag1 libldb1 liblqr-1-0
libmagickcore5 libmagickwand5 libmhash2 libmp3lame0 libmspub-0.0-0
libmythes-1.2-0 libneon27-gnutls libnspr4 libnss3 libnss3-1d libnss3-nssdb
libntdb1 liboauth-php libogg0 libopenjpeg2 libopus0 liborbit-2-0 liborbit2
liborc-0.4-0 liborcus-0.6-0 libpaper-utils libpaper1 libphp-pclzip
libphp-phpmailer libpoppler44 libpulse0 libpython3.4 libraptor2-0 librasqal3
libraw1394-11 librdf0 libreoffice libreoffice-avmedia-backend-gstreamer
libreoffice-base libreoffice-base-core libreoffice-base-drivers
libreoffice-calc libreoffice-common libreoffice-core libreoffice-draw
libreoffice-gnome libreoffice-gtk libreoffice-impress
libreoffice-java-common libreoffice-math libreoffice-pdfimport
libreoffice-report-builder-bin libreoffice-sdbc-firebird
libreoffice-sdbc-hsqldb libreoffice-style-galaxy libreoffice-style-human
libreoffice-writer libsamplerate0 libschroedinger-1.0-0 libsdl1.2debian
libsecret-1-0 libsecret-common libservlet3.0-java libsmbclient libsndfile1
libspeex1 libswscale2 libtalloc2 libtdb1 libtevent0 libtheora0
libtidy-0.99-0 libudisks2-0 libva1 libvisio-0.0-0 libvorbis0a libvorbisenc2
libvorbisfile3 libwbclient0 libwpd-0.9-9 libwpg-0.2-2 libwps-0.2-2
libx264-142 libxaw7 libxcb-shape0 libxfont1 libxft2 libxmu6 libxmuu1
libxslt1.1 libxt6 libxv1 libxvidcore4 libxxf86dga1 libyajl2
libzend-framework-php lp-solve mediawiki-classes openjdk-7-jre
openjdk-7-jre-headless owncloud owncloud-doc php-aws-sdk php-crypt-blowfish
php-doctrine-common php-dompdf php-dropbox php-font-lib php-getid3
php-google-api-php-client php-guzzle php-irods-prods php-opencloud
php-patchwork-utf8 php-pear php-phpdocx php-sabre-dav php-sabre-vobject
php-seclib php-services-json php-symfony-console php-symfony-eventdispatcher
php-symfony-routing php-tcpdf php-xml-parser php5-apcu php5-curl
php5-imagick php5-intl php5-ldap php5-oauth php5-tidy php5-xsl
policykit-1-gnome poppler-data python-crypto python-ldb python-ntdb
python-samba python-talloc python-tdb python3-uno samba-common
samba-common-bin samba-libs sdop smbclient sound-theme-freedesktop
ttf-dejavu-core tzdata-java udisks2 uno-libs3 ure vorbis-tools x11-utils
xfonts-encodings xfonts-mathml xfonts-utils zend-framework
zend-framework-bin[/Expand]
2. Owncloud herunterladen, entpacken und verschieben

cd /tmp/
wget https://download.owncloud.org/community/owncloud-7.0.2.tar.bz2
tar xfvj owncloud-7.0.2.tar.bz2
mv owncloud /var/www/html/
chown www-data:www-data -R /var/www/html/owncloud/

3. Jetzt über phpmyadmin eine Datenbank & Benutzer für Owncloud erstellen
4. Owncloud installieren http://meinserver.de/owncloud
Als Datenpfad geben wir unser Mountpunkt des Truecryptcontainers an, z.B. /media/data/oc
Das sollte jetzt erst einmal funktionieren, dann können wir anschließend noch mit der SSL-Verschlüsselung weitermachen.
Um nicht ein selbst-signiertes Zertifikat nutzen zu müssen, verwende ich ein kostenloses Start-SSL Zertifikat. Mann kann sich dort umsonst ein Konto erstellen, nachdem man seine persönlichen Daten angegeben hat und nach erfolgreicher Validierung auch Zertifikate für seine Domain erstellen.
SSL Aktivieren und Zertifikat erzeugen:

a2enmod ssl
service apache2 restart

Zertifikatskey und Request erstellen:

mkdir /etc/apache2/ssl
cd /etc/apache2/ssl
openssl genrsa -out certificate.key 4096

Für den Key würde ich persönlich kein Passwort festlegen, weil man sonst bei jedem Apache neustart dieses Passwort eingeben müsste.
Zertifikats Request erzeugen:

openssl req -new -key certificate.key -out myserver.de.csr
vi myserver.de.csr

Mit diesem Request kann man sich nun bei startssl.com ein Zertifikat erzeugen, dieses dann unter /etc/apache2/ssl/certificate.cer abspeichern.
Nun müssen noch die Root-Zertifikate der Zertifizierungsstelle heruntergeladen werden. Bei StartSSL sind das die folgenden:

wget --no-check-certificate https://www.startssl.com/certs/sub.class1.server.ca.pem
wget --no-check-certificate https://www.startssl.com/certs/ca.pem

Nun die Apache Konfiguration anpassen:

vi /etc/apache2/sites-available/default-ssl.conf

Hier folgende Einträge setzen (Pfade ggf. anpassen):

ServerAdmin webmaster@deineDomain.de
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/certificate.cer
SSLCertificateKeyFile /etc/apache2/ssl/certificate.key
SSLCertificateChainFile /etc/apache2/ssl/sub.class1.server.ca.pem
SSLCACertificateFile /etc/apache2/ssl/ca.pem

Anschließend die SSL Konfiguration aktivieren und Apache neustarten:

a2ensite default-ssl.conf
service apache2 reload

Wenn hier keine Fehlermeldung kommt dann sieht alles gut aus.
Anschließend mal die Seite über https aufrufen:
https://meinServer.de/owncloud
Im Browser müsste dass dann wie folgt aussehen:
ssl
In den Owncloud Einstellungen würde ich jetzt noch die Option „Enforce HTTPS Encryption aktivieren“, dann wird keine unverschlüsselte HTTP Verbindung mehr benutzt.
Dateibasierte Verschlüsselung aktivieren:
Zusätzliches gibt es ein Encryption Modul innerhalb von Owncloud, was die Dateien selbst nochmal verschlüsselt:
encryptionrecovery-key
Nach dem aktivieren des Modules muss man sich neu anmelden, dabei werden die Verschlüsselungskeys erzeugt.
Unter den Einstellungen kann man zusätzlich noch ein Recovery Key eingeben, mit dem man im Notfall die einzelnen Dateien entschlüsseln kann.

Howto: Wie man das LG G3 einfach rootet

LG G3Das neue LG G3 ist seit ein paar Wochen zu haben, und schon gibt es auch eine sehr einfache Methode wie man es rooten kann.
Das Tool heißt ioroot und ist eine Art Jailbrake was einen Bug in adb ausnutzt. Ioroot funktioniert bei vielen LG Smartphones und Tablets.
Folgende Modelle des G3 werden unterstützt:
D850 – 4.4.2 10D
D851 – nope
D855 – 4.4.2 XXX
F400K/L/S – 4.4.2 10A/10B
LS990 – 4.4.2 ZV2
VS985 – 4.4.2 10B

Ihr benötigt:
ioroot -> Download -> (Orignal xda-developers Link)
Die ADB Treiber für das LG Handy, ich habe die beiden hier installiert:
3.11 driver: tool.xcdn.gdms.lge.com/dn/downloader.dev?fileKey=STsLeI24273250272504102
VZW driver: tool.xcdn.gdms.lge.com/dn/downloader.dev?fileKey=UW00520120427
USB-Debugging eingeschaltet
Schritt 1: Entwicklermodus freischalten
Unter Einstellungen -> Allgemein -> Telefoninfo -> Software-Information müsst 5 Mal auf die Build-Nummer klicken um den Entwicklermodus zu aktivieren
Schritt 2: USB-Debugging aktivieren
Unter Einstellungen -> Allgemein -> Entwickleroptionen -> USB-Debugging aktivieren
Schritt 3: Treiber und Software installieren
Die ADB-Treiber (siehe oben) installieren, ioroot entpacken und das LG G3 per USB Anschließen
Schritt 4: Rooten
ioroot.bat ausführen und den Anweisungen folgen
Als erstes müsst ihr nun auf dem Handy den Zugriff vom PC gestatten (RSA-Fingerabdruck).
Dann kopiert das Tool ein paar Dateien und startet ins Recovery, dort muss man dann noch ADB-Sideload aktivieren und fertig.
Schritt 5: SuperUser App installieren
Nachdem das Handy nun neugestartet hat, ist es gerootet. Ihr könnt jetzt noch ein Superuser App eurer Wahl installieren. Zum Beispiel SuperSu.
Nach einem Firmwareupdate sind die Root-Rechte vermutlich wieder weg und die Schritte müssen wiederholt werden. Das sollte aber kein Problem sein.
Fertig!
[appbox googleplay eu.chainfire.supersu]
[appbox googleplay com.koushikdutta.superuser]

Howto: Root für Samsung Galaxy S5

Um auch beim neusten Galaxy S5 wieder an Root Rechte zu kommen hier eine kleine Anleitung. Der ganze Prozess dauert keine 5 Minuten, sofern ihr schon die Treiber installiert habt.
Info: Durch das Prozedere wird ein Fuse-Bit gesetzt, auch bekannt als Knox-Bit wodurch der Hersteller herausbekommt, dass das Gerät verändert wurde. Dies kann unter Umständen Einflüsse auf die Garantie haben.
[stextbox id=“info“]Euer Modelltyp bekommt ihr heraus über: Einstellungen -> Geräteinformationen -> Modellnummer[/stextbox]
Ihr benötigt folgende Software/Tools:
Samsung USB-Treiber – Download hier.
CF Auto Root – bekommt ihr hier. Es gibt unterschiedliche Versionen für alle Modelle.
Odin 3.09 – bekommt ihr hier.
[stextbox id=“info“]In den Downloadmodus kommt ihr wie folgt: Handy ausschalten -> Home & Powerbutton & Leister gleichzeitig drücken.[/stextbox]
Howto Root:
1. Odin starten und auf den PDA Button klicken. Dort die entpackte CF Root Datei (.tar.md5) auswählen.
Keine anderen Einstellungen setzen. Der Hacken bei Repartition sollte NICHT gesetzt sein!
2. Handy in den Downloadmodus bringen und per USB anschließen
3. Startbutton in Odin drücken.
Nun wird ein modifiziertes Recovery geflasht und anschließend das Handy neu gestartet.
4. Fertig
2014-04-30 09.34.09_compressed

Howto: Asus Transformer Pad TF300T rooten bei gesperrtem Bootloader

asus-tf300tWieder einmal ein kleiner Beitrag was rooten angeht. Diesmal geht’s um das Asus Transformer Pad TF300T. Meiner Meinung nach eines der besten Tablets im Moment. Würde ich eines suchen, dann wäre dies auch meine Wahl. Vor allem das Keydock – die Tastatur welche die Funktion als Cover, Dock und sogar als Zusatzakku vereint gibt es so bei keinem anderem Tablet.
Auch hier kann man sich natürlich root Rechte verschaffen – und dass auch bei gesperrtem Bootloader.
Das reicht für die meisten Anwender auch vollkommen und sichert euch auch noch die Garantie. Bei entsperrtem Bootloader kann man zwar Custom-Roms installieren hat aber in den meisten Fällen nur eingeschränkte Garantie, weil dadurch auch leichter ein Hardwareschaden zu produzieren ist.
Das rooten ist super einfach und in unter 5 Minuten erledigt.
Die Methode funktioniert bei folgenden Geräten:

TF300T - 4.1.1
TF300T - 4.2.1
TF300TG - 4.1.1
TF201
TF700 - 4.1.1
TF700 - 4.2.1
ME301T - 4.2.1 (Memo Smart Pad 10)
Nexus 7
Asus Transformer AIO P1801 B100K - 4.2.1

Schritt 1: Treiber installieren (sofern nicht vorhanden)
Die Asus Treiber könnt ihr hier herunterladen. (Quelle: XDA)
Schritt 2: USB Debugging aktivieren
Dies findet ihr in den Entwickler-Optionen. Der Menüpunkt ist allerdings versteckt, kann angezeigt werden indem ihr auf -> Einstellungen -> About / Telefoninfo geht und dort 7 mal auf die Build-Nummer klickt.
Schritt 3: Root Toolkit ausführen / run.bat
Das Rootprogramm genannt „motochopper“ bekommt ihr hier. Einfach entpacken und die run.bat ausführen. (Quelle: XDA)
Nach erfolgreichem root startet das Tablet neu und ihr habt das Superuser App „SuperSU“ installiert.
Viel Spaß damit.

Howto: proftpd & proftpadmin installieren (Ubuntu 12.10)

Mit einer der bekanntesten FTP-Server dürfte der proftpd sein. Ich schreibe euch hier ein kleines Tutorial wie man diesen und den komfortablen Web-Admin installiert.
Schritt 1: Mysql Datenbank & Benutzer anlegen
Wie man einen User und dazugehörige Datenbank anlegt beschreibe ich jetzt nicht näher. Via phpmyadmin ist das ja schnell gemacht.
Nun die zwei Tabellen erzeugen. Ich habe die tables.sql etwas angepasst, da ich immer über SQL-Fehler gestolpert bin:

ERROR 1064 (42000) at line 5: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server versio n for the right syntax to use near 'TYPE=InnoDB' at line 6
ERROR 1067 (42000) at line 16: Invalid default value for 'uid'

Folgendes funktioniert bei mir:

CREATE TABLE `users` (
`id` smallint(2) NOT NULL auto_increment,
`userid` varchar(10) NOT NULL default '',
`uid` int(10) unsigned NOT NULL default '0',
`gid` int(10) unsigned NOT NULL default '0',
`passwd` varchar(255) NOT NULL default '',
`homedir` varchar(255) NOT NULL default '',
`comment` varchar(255) NOT NULL default '',
`disabled` int(10) unsigned NOT NULL default '0',
`shell` varchar(20) NOT NULL default '/sbin/nologin',
`email` varchar(255) NOT NULL default '',
`name` varchar(255) NOT NULL default '',
`ul_bytes` bigint(20) NOT NULL default '0',
`dl_bytes` bigint(20) NOT NULL default '0',
`login_count` bigint(20) NOT NULL default '0',
`dl_count` bigint(20) NOT NULL default '0',
`ul_count` bigint(20) NOT NULL default '0',
`last_login` datetime default NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM ;
CREATE TABLE `groups` (
`groupid` varchar(10) NOT NULL default '',
`gid` int(10) unsigned NOT NULL auto_increment,
`members` varchar(255) NOT NULL default '',
PRIMARY KEY (`gid`)
) ENGINE=MyISAM ;

Schritt 2: proftpd installieren
….weiterlesen.

Weiterlesen

Howto: QNAP HD Station und XBMC konfigurieren

Seit ein paar Tagen gibt’s die HDStation ja schon, aber vielleicht noch den ein oder anderen Trick. Deswegen schreibe ich hier mal ein kleines Howto, wie ihr auf eurem QNAP das XBMC richtig eingestellt bekommt.
Schritt 1: Aktuelle FW installieren
Ihr benötigt die aktuelle Firmware 3.8.1 welche ihr entweder als Live Update oder manuelles Update bekommt.
fw381
Schritt 2: HD Station herunterladen & aktivieren
Jetzt ist im Applikation’s Menü die HD Station verfügbar. Diese muss heruntergeladen & aktiviert werden.
enableHDStation

Schritt 3: XBMC herunterladen & aktivieren
Jetzt könnt ihr die „Apps“ für die HDStation herunterladen. Neben XBMC gibt es noch den Chrome Webbrowser, MyNas und Youtube. Via Online Download oder manuell.
hdstationDownloadApps
… weiterlesen.

Weiterlesen

Howto upgrade: Spiceworks 6

Gestern wurde Spiceworks 6 released. Wie gewohnt kann man von den alten Versionen direkt auf die neuste migrieren. Dazu einfach das setup herunterladen und starten.
Ich hatte auch zuerst noch ein Backup der SW Datenbank gemacht, was allerdings unnötig ist – da Spiceworks selbst vorher nochmal eine Sicherung anlegt.

 
Wie ich festgestellt habe war das Dashboard auf eine Max-Breite eingestellt, was man aber nur mit einer 1920*1080 Auflösung bemerkt. Abhilfe sorgt das „Remove Max Width SW6“ Plugin.
Auch ganz nett der „Attachment Image Viewer„. Er sorgt dafür, dass man sich Bilder im Helpdesk direkt anschauen kann ohne sie wie bisher erst herunterzuladen.

How to install Nagios, Centreon, Nagvis, Check_MK @ Ubuntu 12.04 Server

Ich arbeite schon seit mehreren Jahren mit Nagios vorallem aber mit der Oberfläche: Centreon. Wer Nagios noch per Shell bedient und somit hunderte Config-Files pflegt müsste Centreon eigentlich lieben.
Eine Oberfläche von der aus alles gesteuert wird. Komfortables anlegen von Hosts, Diensten und allen notwendigen Gruppen. Mit mehreren Klicks – keine Config-Files mehr – diese werden dann durch Centreon automatisch erstellt.
Zur grafischen Anzeige benutze ich Nagvis was noch die Erweiterung check_mk benötigt. Damit lassen sich dann nette Weathermaps erstellen oder den Serverraum in einem Bild mit dem dazugehörigen Host/Service-Status darstellen.
Als Betriebssystem nutze ich ausschließlich nur Ubuntu – daher ist das Komplettpaket „FAN – Fully automated Nagios“ (CentOS) für micht nicht interessant.
Hier ein Howto zur Installation von Nagios, Centreon, Check_MK und Nagvis. In naher Zukunft werde ich auch mal ein .OVF Template erstellen….
Vorraussetzungen:
-> Ubuntu 12.04 Server installiert.
Bevor wir anfangen noch obligatorisch die Updates machen:

apt-get update
apt-get upgrade
apt-get dist-upgrade

Notwendige Abhängigkeiten installieren:

apt-get install gcc make g++ lsb-release tofrodos apache2 apache2.2-common apache2-doc apache2-mpm-prefork apache2-utils libapache2-mod-python libexpat1 ssl-cert libapache2-mod-php5 php5 php5-common php5-gd php5-mysql php5-imap phpmyadmin php5-cli apache2-suexec php-pear php-auth php5-mcrypt mcrypt libapache2-mod-suphp php5-snmp php5-ldap mysql-server rrdtool librrds-perl libconfig-inifiles-perl libcrypt-des-perl libgd-gd2-perl snmp snmpd libnet-snmp-perl libsnmp-perl libgd2-xpm libgd2-xpm-dev bsd-mailx postfix

GGf. Vmware Tools installieren (VMware Tools mounten):

mkdir /mnt/cdrom
mount /dev/cdrom /mnt/cdrom
mount: blockorientiertes Gerät /dev/sr0 ist schreibgeschützt, wird eingehängt im Nur-Lese-Modus
tar xzfv /mnt/cdrom/VMwareTools-8.6.5-652272.tar.gz -C /tmp/
root@centreon:~# cd /tmp/vmware-tools-distrib/
./vmware-install.pl

Ich habe die VM-Tools mit Standardeinstellungen installiert. Anschließend Reboot:

shutdown -r now

GGf. Proxy im Wget eintragen:

vi /etc/wgetrc

Installation von Nagios:
Hier gibt es zwei Möglichkeiten. Entweder von Hand installieren, oder die fertigen Packete nutzen. Ich empfehle es von Hand zu installieren, da die Pakete oftmals nicht aktuell sind.
Also finger weg von: apt-get install nagios3 nagios-plugins
Nagios benutzer anlegen:

/usr/sbin/useradd -m -s /bin/bash nagios
passwd nagios

Gruppe anlegen:

/usr/sbin/groupadd nagios

Gruppe hinzufügen:

/usr/sbin/groupadd nagcmd
/usr/sbin/usermod -G nagcmd nagios
/usr/sbin/usermod -G nagcmd www-data

Nagios herunterladen:

wget http://downloads.sourceforge.net/project/nagios/nagios-3.x/nagios-3.4.1/nagios-3.4.1.tar.gz?r=http%3A%2F%2Fwww.nagios.org%2Fdownload%2Fcore%2Fthanks%2F&ts=1340721679&use_mirror=garr
mv nagios-3.4.1.tar.gz\?r\=http\:%2F%2Fwww.nagios.org%2Fdownload%2Fcore%2Fthanks%2F nagios-3.4.1.tar.gz
tar xzfv nagios-3.4.1.tar.gz
cd nagios/

Nagios Configurieren:

./configure --with-nagios-group=nagios --with-nagios-user=nagios --with-command-group=nagcmd
Creating sample config files in sample-config/ ...

[EXPAND Configuration Log]
*** Configuration summary for nagios 3.4.1 05-11-2012 ***:
General Options:
————————-
Nagios executable: nagios
Nagios user/group: nagios,nagios
Command user/group: nagios,nagcmd
Embedded Perl: no
Event Broker: yes
Install ${prefix}: /usr/local/nagios
Lock file: ${prefix}/var/nagios.lock
Check result directory: ${prefix}/var/spool/checkresults
Init directory: /etc/init.d
Apache conf.d directory: /etc/apache2/conf.d
Mail program: /bin/mail
Host OS: linux-gnu
Web Interface Options:
————————
HTML URL: http://localhost/nagios/
CGI URL: http://localhost/nagios/cgi-bin/
Traceroute (used by WAP):
Review the options above for accuracy. If they look okay,
type ‚make all‘ to compile the main program and CGIs.
root@centreon:/tmp/nagios#
*** Compile finished ***[/EXPAND]
Nagios installieren:

make all
make install
make install-commandmode
make install-config
make install-init
make install-webconf

Nagiosadmin (für Webinterface anlegen):

htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
New password:
Re-type new password:
Adding password for user nagiosadmin

Autostart hinzufügen:

ln -s /etc/init.d/nagios /etc/rcS.d/S99nagios

Nagios-Plugins installieren:

wget http://downloads.sourceforge.net/project/nagiosplug/nagiosplug/1.4.15/nagios-plugins-1.4.15.tar.gz?r=http%3A%2F%2Fwww.nagios.org%2Fdownload%2Fplugins%2F&ts=1340722460&use_mirror=dfn
mv nagios-plugins-1.4.15.tar.gz\?r\=http\:%2F%2Fwww.nagios.org%2Fdownload%2Fplugins%2F nagios-plugins-1.4.15.tar.gz
tar xzfv nagios-plugins-1.4.15.tar.gz
./configure
make
make install

Nagios starten:

/etc/init.d/nagios start

Mal die Webseite aufrufen: http://server/nagios
Benutzer: nagiosadmin
Prüfen ob Statusmap funktioniert.
Bei dem Fehler: The requested URL /nagios/cgi-bin/statusmap.cgi was not found on this server
Nochmal ausführen:

apt-get install libgd2-xpm libgd2-xpm-dev
root@centreon:/tmp/nagios# make cgis
cp /usr/nagios-3.2.3/cgi/*.cgi /usr/local/nagios/sbin
chown nagios:nagios /usr/local/nagios/sbin/*.cgi

Nagios neustarten

/etc/init.d/nagios restart

ndoutils installieren:

wget http://downloads.sourceforge.net/project/nagios/ndoutils-1.x/ndoutils-1.5.2/ndoutils-1.5.2.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fnagios%2Ffiles%2Fndoutils-1.x%2Fndoutils-1.5.2%2F&ts=1340723870&use_mirror=garr
cd ndoutils-1.5.2/
./configure
make
make install

[EXPAND Setuplog]
/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/bin
/usr/bin/install -c -m 755 -o nagios -g nagios ndo2db-3x /usr/local/nagios/bin/ndo2db
/usr/bin/install -c -m 755 -o nagios -g nagios ndomod-3x.o /usr/local/nagios/bin/ndomod.o
/usr/bin/install -c -m 774 -o nagios -g nagios file2sock /usr/local/nagios/bin
/usr/bin/install -c -m 774 -o nagios -g nagios log2ndo /usr/local/nagios/bin
/usr/bin/install -c -m 774 -o nagios -g nagios sockdebug /usr/local/nagios/bin
Hint: NDOUtils Installation against Nagios v3.x
completed.
If you want to install NDOUtils for Nagios v2.x
please type ‚make install-2x
Next step should be the database initialization/upgrade
cd into the db/ directory and either:
./installdb (for a new installation) or:
./upgradedb (for an existing one)
make[1]: Verlasse Verzeichnis ‚/tmp/ndoutils-1.5.2/src‘
Main NDOUtils components installed[/EXPAND]
So nun kann Centeron installiert werden. Beachtet das hier ggf. eine direkte Internetverbindung benötigt wird, da durch das Setup einige PEAR Komponenten aktualisiert werden.
Centreon installieren:

wget http://download.centreon.com/index.php?id=181
mv index.php\?id\=181 centreon.2.3.8.tar.gz
tar xzfv centreon.2.3.8.tar.gz
./install.sh -i

[EXPAND Centreon Setup]
Do you accept GPL license ?
[y/n], default to [n]:
> y
————————————————————————
Please choose what you want to install
————————————————————————
Do you want to install : Centreon Web Front
[y/n], default to [n]:
> y
Do you want to install : Centreon CentCore
[y/n], default to [n]:
> y
Do you want to install : Centreon Nagios Plugins
[y/n], default to [n]:
> y
Do you want to install : Centreon Snmp Traps process
[y/n], default to [n]:
> y
————————————————————————
Start CentWeb Installation
————————————————————————
Where is your Centreon directory?
default to [/usr/local/centreon]
>
Do you want me to create this directory ? [/usr/local/centreon]
[y/n], default to [n]:
> y
Path /usr/local/centreon OK
Where is your Centreon log directory
default to [/usr/local/centreon/log]
>
Do you want me to create this directory ? [/usr/local/centreon/log]
[y/n], default to [n]:
> y
Path /usr/local/centreon/log OK
Where is your Centreon etc directory
default to [/etc/centreon]
>
Do you want me to create this directory ? [/etc/centreon]
[y/n], default to [n]:
> y
Path /etc/centreon OK
Where is your Centreon generation_files directory?
default to [/usr/local/centreon]
>
Path /usr/local/centreon OK
Where is your Centreon variable library directory?
default to [/var/lib/centreon]
>
Do you want me to create this directory ? [/var/lib/centreon]
[y/n], default to [n]:
> y
Path /var/lib/centreon OK
Where is your CentPlugins Traps binary
default to [/usr/local/centreon/bin]
>
Do you want me to create this directory ? [/usr/local/centreon/bin]
[y/n], default to [n]:
> y
Path /usr/local/centreon/bin OK
Where is the RRD perl module installed [RRDs.pm]
default to [/usr/lib/perl5/RRDs.pm]
>
Path /usr/lib/perl5 OK
/usr/bin/rrdtool OK
Where is mail binary
default to [/usr/bin/mail]
> /usr/bin/mailx
/usr/bin/mailx OK
Where is PEAR [PEAR.php]
default to [/usr/share/php/PEAR.php]
>
Path /usr/share/php OK
Where is installed Nagios ?
default to [/usr/local/nagios]
>
Path /usr/local/nagios OK
Where is your nagios config directory
default to [/usr/local/nagios/etc]
>
Path /usr/local/nagios/etc OK
Where is your Nagios var directory ?
default to [/usr/local/nagios/var]
>
Path /usr/local/nagios/var OK
Where is your Nagios plugins (libexec) directory ?
default to [/usr/local/nagios/libexec]
>
Path /usr/local/nagios/libexec OK
Where is your nagios binary ?
default to [/usr/local/nagios/bin/nagios]
>
/usr/local/nagios/bin/nagios OK
Where is your Nagios image directory ?
default to [/usr/local/nagios/share/images/logos]
>
Path /usr/local/nagios/share/images/logos OK
Where is your nagiostats binary ?
default to [/usr/local/nagios/bin/nagiostats]
>
/usr/local/nagios/bin/nagiostats OK
p1_file : /usr/local/nagios/bin/p1.pl OK
/usr/bin/php OK
/usr/bin/perl OK
Finding Apache group : www-data
Finding Apache user : www-data
Finding Nagios user : nagios
Finding Nagios group : nagios
Where is your NDO ndomod binary ?
default to [/usr/sbin/ndomod.o]
> /usr/local/nagios/bin/ndomod.o
/usr/local/nagios/bin/ndomod.o OK
————————————————————————
Configure Sudo
————————————————————————
Where is sudo configuration file
default to [/etc/sudoers]
>
/etc/sudoers OK
Nagios init script OK
Your sudo is not configured
Do you want me to configure your sudo ? (WARNING)
[y/n], default to [n]:
> y
Configuring Sudo OK
————————————————————————
Configure Apache server
————————————————————————
Do you want to add Centreon Apache sub configuration file ?
[y/n], default to [n]:
> y
Create ‚/etc/apache2/conf.d/centreon.conf‘ OK
Configuring Apache OK
Do you want to reload your Apache ?
[y/n], default to [n]:
> y
Reloading Apache service OK
Preparing Centreon temporary files
Change right on /usr/local/centreon/log OK
Change right on /etc/centreon OK
Change right on /usr/local/nagios/share/images/logos OK
Install nagios documentation OK
Change macros for insertBaseConf.sql OK
Change macros for php files OK
Change right on /usr/local/nagios/etc OK
Copy CentWeb in system directory
Install CentWeb (web front of centreon) OK
Install libraries OK
Copying libinstall OK
Change macros for centreon.cron OK
Install Centreon cron.d file OK
Change macros for centAcl.php OK
Change macros for downtimeManager.php OK
Change macros for eventReportBuilder.pl OK
Change macros for dashboardBuilder.pl OK
Install cron directory OK
Change right for eventReportBuilder.pl OK
Change right for dashboardBuilder.pl OK
————————————————————————
Pear Modules
————————————————————————
Check PEAR modules
PEAR 1.4.9 1.9.4 OK
DB 1.7.6 NOK
DB_DataObject 1.8.4 NOK
DB_DataObject_FormBuilder 1.0.0RC4 NOK
MDB2 2.0.0 NOK
Date 1.4.6 NOK
HTML_Common 1.2.2 NOK
HTML_QuickForm 3.2.5 NOK
HTML_QuickForm_advmultiselect 1.1.0 NOK
HTML_Table 1.6.1 NOK
Archive_Tar 1.1 1.3.7 OK
Auth_SASL 1.0.1 NOK
Console_Getopt 1.2 1.3.0 OK
Net_SMTP 1.2.8 NOK
Net_Socket 1.0.1 NOK
Net_Traceroute 0.21 NOK
Net_Ping 2.4.1 NOK
Validate 0.6.2 NOK
XML_RPC 1.4.5 NOK
SOAP 0.10.1 NOK
Log 1.9.11 NOK
Do you want me to install/upgrade your PEAR modules
[y/n], default to [y]:
> y
Upgrading PEAR modules
Installing PEAR modules
DB 1.7.6 OK
DB_DataObject 1.8.4 1.10.0 OK
DB_DataObject_FormBuilder 1.0.0RC4 1.0.2 OK
MDB2 2.0.0 2.4.1 OK
HTML_QuickForm_advmultiselect 1.1.0 1.5.1 OK
HTML_Table 1.6.1 1.8.3 OK
Auth_SASL 1.0.1 1.0.6 OK
Net_SMTP 1.2.8 1.6.1 OK
Net_Traceroute 0.21 0.21.3 OK
Net_Ping 2.4.1 2.4.5 OK
Validate 0.6.2 0.8.5 OK
XML_RPC 1.4.5 1.5.5 OK
SOAP 0.10.1 0.13.0 OK
Log 1.9.11 1.12.7 OK
Check PEAR modules
PEAR 1.4.9 1.9.4 OK
DB 1.7.6 1.7.14 OK
DB_DataObject 1.8.4 1.10.0 OK
DB_DataObject_FormBuilder 1.0.0RC4 1.0.2 OK
MDB2 2.0.0 2.4.1 OK
Date 1.4.6 1.4.7 OK
HTML_Common 1.2.2 1.2.5 OK
HTML_QuickForm 3.2.5 3.2.13 OK
HTML_QuickForm_advmultiselect 1.1.0 1.5.1 OK
HTML_Table 1.6.1 1.8.3 OK
Archive_Tar 1.1 1.3.7 OK
Auth_SASL 1.0.1 1.0.6 OK
Console_Getopt 1.2 1.3.0 OK
Net_SMTP 1.2.8 1.6.1 OK
Net_Socket 1.0.1 1.0.10 OK
Net_Traceroute 0.21 0.21.3 OK
Net_Ping 2.4.1 2.4.5 OK
Validate 0.6.2 0.8.5 OK
XML_RPC 1.4.5 1.5.5 OK
SOAP 0.10.1 0.13.0 OK
Log 1.9.11 1.12.7 OK
All PEAR modules OK
————————————————————————
Centreon Post Install
————————————————————————
Create /usr/local/centreon/www/install/install.conf.php OK
Create /etc/centreon/instCentWeb.conf OK
————————————————————————
Start CentStorage Installation
————————————————————————
Where is your Centreon Run Dir directory?
default to [/var/run/centreon]
>
Do you want me to create this directory ? [/var/run/centreon]
[y/n], default to [n]:
> y
Path /var/run/centreon OK
Where is your CentStorage binary directory
default to [/usr/local/centreon/bin]
>
Path /usr/local/centreon/bin OK
Where is your CentStorage RRD directory
default to [/var/lib/centreon]
>
Path /var/lib/centreon OK
Finding Nagios group : nagios
Finding Nagios user : nagios
Preparing Centreon temporary files
/tmp/centreon-setup exists, it will be moved…
install www/install/createTablesCentstorage.sql OK
Creating Centreon Directory ‚/var/lib/centreon/status‘ OK
Creating Centreon Directory ‚/var/lib/centreon/metrics‘ OK
Change macros for centstorage binary OK
Install CentStorage binary OK
Install library for centstorage OK
Change right : /var/run/centreon OK
Change macros for centstorage init script OK
Do you want me to install CentStorage init script ?
[y/n], default to [n]:
> y
CentStorage init script installed OK
Do you want me to install CentStorage run level ?
[y/n], default to [n]:
> y
update-rc.d: warning: /etc/init.d/centstorage missing LSB information
update-rc.d: see <http://wiki.debian.org/LSBInitScripts>
Adding system startup for /etc/init.d/centstorage …
/etc/rc0.d/K30centstorage -> ../init.d/centstorage
/etc/rc1.d/K30centstorage -> ../init.d/centstorage
/etc/rc6.d/K30centstorage -> ../init.d/centstorage
/etc/rc2.d/S40centstorage -> ../init.d/centstorage
/etc/rc3.d/S40centstorage -> ../init.d/centstorage
/etc/rc4.d/S40centstorage -> ../init.d/centstorage
/etc/rc5.d/S40centstorage -> ../init.d/centstorage
Configuration file /etc/centreon/conf.pm not found. Exiting.
CentStorage stop FAIL
Change macros for logAnalyser OK
Install logAnalyser OK
Change macros for nagiosPerfTrace OK
Install nagiosPerfTrace OK
Change macros for purgeLogs OK
Install purgeLogs OK
Change macros for purgeCentstorage OK
Install purgeCentstorage OK
Change macros for centreonPurge.sh OK
Install centreonPurge.sh OK
Change macros for centstorage.cron OK
Install CentStorage cron OK
Create /etc/centreon/instCentStorage.conf OK
————————————————————————
Start CentCore Installation
————————————————————————
Where is your CentCore binary directory
default to [/usr/local/centreon/bin]
>
Path /usr/local/centreon/bin OK
/usr/bin/ssh OK
/usr/bin/scp OK
Finding Nagios group : nagios
Finding Nagios user : nagios
Preparing Centreon temporary files
/tmp/centreon-setup exists, it will be moved…
Change CentCore Macro OK
Copy CentCore in binary directory OK
Change right : /var/run/centreon OK
Change right : /var/lib/centreon OK
Replace CentCore init script Macro OK
Do you want me to install CentCore init script ?
[y/n], default to [n]:
> y
CentCore init script installed OK
Do you want me to install CentCore run level ?
[y/n], default to [n]:
> y
update-rc.d: warning: /etc/init.d/centcore missing LSB information
update-rc.d: see <http://wiki.debian.org/LSBInitScripts>
Adding system startup for /etc/init.d/centcore …
/etc/rc0.d/K30centcore -> ../init.d/centcore
/etc/rc1.d/K30centcore -> ../init.d/centcore
/etc/rc6.d/K30centcore -> ../init.d/centcore
/etc/rc2.d/S40centcore -> ../init.d/centcore
/etc/rc3.d/S40centcore -> ../init.d/centcore
/etc/rc4.d/S40centcore -> ../init.d/centcore
/etc/rc5.d/S40centcore -> ../init.d/centcore
Create /etc/centreon/instCentCore.conf OK
————————————————————————
Start CentPlugins Installation
————————————————————————
Where is your CentPlugins lib directory
default to [/var/lib/centreon/centplugins]
>
Do you want me to create this directory ? [/var/lib/centreon/centplugins]
[y/n], default to [n]:
> y
Path /var/lib/centreon/centplugins OK
Finding Nagios user : nagios
Finding Nagios group : nagios
Preparing Centreon temporary files
/tmp/centreon-setup exists, it will be moved…
Change macros for CentPlugins OK
Installing the plugins OK
Change right on centreon.conf OK
CentPlugins is installed
————————————————————————
Start CentPlugins Traps Installation
————————————————————————
Where is your SNMP configuration directory
default to [/etc/snmp]
>
/etc/snmp OK
Where is your SNMPTT binaries directory
default to [/usr/local/centreon/bin/]
>
/usr/local/centreon/bin/ OK
Finding Nagios group : nagios
Finding Apache user : www-data
Preparing Centreon temporary files
/tmp/centreon-setup exists, it will be moved…
Change macros for CentPluginsTraps OK
Installing the plugins Trap binaries OK
Change macros for snmptrapd.conf OK
Change macros for snmptt.ini OK
Install : snmptrapd.conf OK
Install : snmp.conf OK
Install : snmptt.ini OK
Install : snmptt OK
Install : snmpttconvertmib OK
Create /etc/centreon/instCentPlugins.conf OK
###############################################################################
# #
# Go to the URL : http://centreon.domain.info/centreon/ #
# to finish the setup #
# #
# Report bugs at http://forge.centreon.com #
# #
# Thanks for using Centreon. #
# ———————– #
# Contact : infos@centreon.com #
# http://www.centreon.com #
# #
###############################################################################[/EXPAND]
Nun die Webseite aufrufen und mit der Installation weitermachen:

http://centreon.domain.info/centreon/


Anschließend Neustart:

shutdown -r now

Nachträglich die LDAP-Authentifizierung über die Centreon Oberfläche einrichten:

Administration - &gt; Options -&gt; Options -&gt; Ldap

Wenn man nun noch Nagvis installieren will – gehts weiter.
Zuerst muss check_mk installiert werden:

wget http://mathias-kettner.de/download/check_mk-1.2.0p1.tar.gz
tar xzfv check_mk-1.2.0p1.tar.gz
cd check_mk-1.2.0p1
./setup.sh
Hier alles wieder mit Standart-Einstellungen installiert

[EXPAND check_MK Setup]
./setup.sh
Check_MK setup Version: 1.2.0p1
Welcome to Check_MK. This setup will install Check_MK into user defined
directories. If you run this script as root, installation paths below
/usr will be suggested. If you run this script as non-root user paths
in your home directory will be suggested. You may override the default
values or just hit enter to accept them.
Your answers will be saved to /home/centreon/.check_mk_setup.conf and will be
reused when you run the setup of this or a later version again. Please
delete that file if you want to delete your previous answers.
* Found running Nagios process, autodetected 18 settings.
1) Installation directories of check_mk
Executable programs
Directory where to install executable programs such as check_mk itself.
This directory should be in your search path ($PATH). Otherwise you
always have to specify the installation path when calling check_mk:
( default –> /usr/bin):
Check_MK configuration
Directory where check_mk looks for its main configuration file main.mk.
An example configuration file will be installed there if no main.mk is
present from a previous version:
( default –> /etc/check_mk):
Check_MK software
The base directory for the software installation of Check_MK. This
directory will get the subdirectories checks, modules, web, locale and
agents. Note: in previous versions it was possible to specify each of
those directories separately. This is no longer possible:
( default –> /usr/share/check_mk):
documentation
Some documentation about check_mk will be installed here. Please note,
however, that most of check_mk’s documentation is available only online at
http://mathias-kettner.de/check_mk.html:
( default –> /usr/share/doc/check_mk):
check manuals
Directory for manuals for the various checks. The manuals can be viewed
with check_mk -M <CHECKNAME>:
( default –> /usr/share/doc/check_mk/checks):
working directory of check_mk
check_mk will create caches files, automatically created checks and
other files into this directory. The setup will create several subdirectories
and makes them writable by the Nagios process:
( default –> /var/lib/check_mk):
 
2) Configuration of Linux/UNIX Agents
extensions for agents
This directory will not be created on the server. It will be hardcoded
into the Linux and UNIX agents. The agent will look for extensions in the
subdirectories plugins/ and local/ of that directory:
( default –> /usr/lib/check_mk_agent):
configuration dir for agents
This directory will not be created on the server. It will be hardcoded
into the Linux and UNIX agents. The agent will look for its configuration
files here (currently only the logwatch extension needs a configuration file):
( default –> /etc/check_mk):
 
3) Integration with Nagios
Name of Nagios user
The working directory for check_mk contains several subdirectories
that need to be writable by the Nagios user (which is running check_mk
in check mode). Please specify the user that should own those
directories:
( autodetected –> nagios):
User of Apache process
Check_MK WATO (Web Administration Tool) needs a sudo configuration,
such that Apache can run certain commands as root. If you specify
the correct user of the apache process here, then we can create a valid
sudo configuration for you later::
( autodetected –> www-data):
Common group of Nagios+Apache
Check_mk creates files and directories while running as nagios.
Some of those need to be writable by the user that is running the webserver.
Therefore a group is needed in which both Nagios and the webserver are
members (every valid Nagios installation uses such a group to allow
the web server access to Nagios‘ command pipe)::
( autodetected –> nagcmd):
Nagios binary
The complete path to the Nagios executable. This is needed by the
option -R/–restart in order to do a configuration check.:
( autodetected –> /usr/local/nagios/bin/nagios):
Nagios main configuration file
Path to the main configuration file of Nagios. That file is always
named ’nagios.cfg‘. The default path when compiling Nagios yourself
is /usr/local/nagios/etc/nagios.cfg. The path to this file is needed
for the check_mk option -R/–restart:
( autodetected –> /usr/local/nagios/etc/nagios.cfg):
Nagios object directory
Nagios‘ object definitions for hosts, services and contacts are
usually stored in various files with the extension .cfg. These files
are located in a directory that is configured in nagios.cfg with the
directive ‚cfg_dir‘. Please specify the path to that directory
(If the autodetection can find your configuration
file but does not find at least one cfg_dir directive, then it will
add one to your configuration file for your conveniance):
( autodetected –> /usr/local/nagios/etc/check_mk.d):
Nagios startskript
The complete path to the Nagios startskript is used by the option
-R/–restart to restart Nagios.:
( autodetected –> /etc/init.d/nagios):
Nagios command pipe
Complete path to the Nagios command pipe. check_mk needs write access
to this pipe in order to operate:
( autodetected –> /usr/local/nagios/var/rw/nagios.cmd):
Check results directory
Complete path to the directory where Nagios stores its check results.
Using that directory instead of the command pipe is faster.:
( default –> /usr/local/nagios/var/spool/checkresults):
Nagios status file
The web pages of check_mk need to read the file ’status.dat‘, which is
regularily created by Nagios. The path to that status file is usually
configured in nagios.cfg with the parameter ’status_file‘. If
that parameter is missing, a compiled-in default value is used. On
FHS-conforming installations, that file usually is in /var/lib/nagios
or /var/log/nagios. If you’ve compiled Nagios yourself, that file
might be found below /usr/local/nagios:
( autodetected –> /usr/local/nagios/var/status.log):
Path to check_icmp
check_mk ships a Nagios configuration file with several host and
service templates. Some host templates need check_icmp as host check.
That check plugin is contained in the standard Nagios plugins.
Please specify the complete path (dir + filename) of check_icmp:
( autodetected –> /usr/local/nagios/libexec/check_icmp):
 
4) Integration with Apache
URL Prefix for Web addons
Usually the Multisite GUI is available at /check_mk/ and PNP4Nagios
is located at /pnp4nagios/. In some cases you might want to define some
prefix in order to be able to run more instances of Nagios on one host.
If you say /test/ here, for example, then Multisite will be located
at /test/check_mk/. Please do not forget the trailing slash.:
( default –> /):
Apache config dir
Check_mk ships several web pages implemented in Python with Apache
mod_python. That module needs an apache configuration section which
will be installed by this setup. Please specify the path to a directory
where Apache reads in configuration files.:
( autodetected –> /etc/apache2/conf.d):
HTTP authentication file
Check_mk’s web pages should be secured from unauthorized access via
HTTP authenticaion – just as Nagios. The configuration file for Apache
that will be installed contains a valid configuration for HTTP basic
auth. The most conveniant way for you is to use the same user file as
for Nagios. Please enter your htpasswd file to use here:
( autodetected –> /usr/local/nagios/etc/htpasswd.users):
HTTP AuthName
Check_mk’s Apache configuration file will need an AuthName. That
string will be displayed to the user when asking for the password.
You should use the same AuthName as for Nagios. Otherwise the user will
have to log in twice:
( autodetected –> Nagios Access):
 
5) Integration with PNP4Nagios 0.6
PNP4Nagios templates
Check_MK ships templates for PNP4Nagios for most of its checks.
Those templates make the history graphs look nice. PNP4Nagios
expects such templates in the directory pnp/templates in your
document root for static web pages:
( default –> /usr/share/check_mk/pnp-templates):
 
6) Check_MK Livestatus Module
compile livestatus module
This version of Check_mk ships a completely new and experimental
Nagios event broker module that provides direct access to Nagios
internal data structures. This module is called the Check_MK Livestatus
Module. It aims to supersede status.dat and also NDO. Currenty it
is completely experimental and might even crash your Nagios process.
Nevertheless – The Livestatus Module does not only allow extremely
fast access to the status of your services and hosts, it does also
provide live data (which status.dat does not). Also – unlike NDO –
Livestatus does not cost you even measurable CPU performance, does
not need any disk space and also needs no configuration.
Please answer ‚yes‘, if you want to compile and integrate the
Livestatus module into your Nagios. You need ‚make‘ and the GNU
C++ compiler installed in order to do this:
( default –> yes):
check_mk’s binary modules
Directory for architecture dependent binary libraries and plugins
of check_mk:
( default –> /usr/lib/check_mk):
Unix socket for Livestatus
The Livestatus Module provides Nagios status data via a unix
socket. This is similar to the Nagios command pipe, but allows
bidirectional communication. Please enter the path to that pipe.
It is recommended to put it into the same directory as Nagios‘
command pipe:
( default –> /usr/local/nagios/var/rw/live):
Backends for other systems
Directory where to put backends and configuration examples for
other systems. Currently this is only Nagvis, but other might follow
later.:
( default –> /usr/share/check_mk/livestatus):
———————————————————————-
You have chosen the following directories:
Executable programs /usr/bin
Check_MK configuration /etc/check_mk
Check_MK software /usr/share/check_mk
documentation /usr/share/doc/check_mk
check manuals /usr/share/doc/check_mk/checks
working directory of check_mk /var/lib/check_mk
extensions for agents /usr/lib/check_mk_agent
configuration dir for agents /etc/check_mk
Name of Nagios user nagios
User of Apache process www-data
Common group of Nagios+Apache nagcmd
Nagios binary /usr/local/nagios/bin/nagios
Nagios main configuration file /usr/local/nagios/etc/nagios.cfg
Nagios object directory /usr/local/nagios/etc/check_mk.d
Nagios startskript /etc/init.d/nagios
Nagios command pipe /usr/local/nagios/var/rw/nagios.cmd
Check results directory /usr/local/nagios/var/spool/checkresults
Nagios status file /usr/local/nagios/var/status.log
Path to check_icmp /usr/local/nagios/libexec/check_icmp
URL Prefix for Web addons /
Apache config dir /etc/apache2/conf.d
HTTP authentication file /usr/local/nagios/etc/htpasswd.users
HTTP AuthName Nagios Access
PNP4Nagios templates /usr/share/check_mk/pnp-templates
compile livestatus module yes
check_mk’s binary modules /usr/lib/check_mk
Unix socket for Livestatus /usr/local/nagios/var/rw/live
Backends for other systems /usr/share/check_mk/livestatus
Proceed with installation (y/n)? y
(Compiling MK Livestatus…………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………..)
Installation completed successfully.
Please restart Nagios and Apache in order to update/active check_mk’s web pages.
You can access the new Multisite GUI at http://localhost/check_mk/[/EXPAND]
Apache & Nagios neustarten:

service apache2 restart
service nagios3 restart

Prüfen ob Check_MK richtig funktioniert:

http://centreon.domain.info/check_mk/

Ich hatte hier schon öfters den Fehler das der Socket nicht funktioniert
Abhilfe hat folgendes gebracht:

/var/lib/nagios/
chmod 777 rw/ -R
vi /etc/group
Der nagios Gruppe noch www-data hinzufügen.

Nagvis Abhängigkeiten:

apt-get install graphviz graphviz-dev php5-gd php5-mysql php5-cli php5-common sqlite3 php5-sqlite
service apache2 restart

Nagivs installieren:

wget http://downloads.sourceforge.net/project/nagvis/NagVis%201.6/nagvis-1.6.6.tar.gz?r=http%3A%2F%2Fwww.nagvis.org%2Fdownloads&amp;ts=1340725577&amp;use_mirror=ignum
mv nagvis-1.6.6.tar.gz\?r\=http\:%2F%2Fwww.nagvis.org%2Fdownloads nagvis-1.6.6.tar.gz
tar xzfv nagvis-1.6.6.tar.gz
cd nagvis-1.6.6/
./install.sh

[EXPAND Navis Setup]
+——————————————————————————+
| Welcome to NagVis Installer 1.6.6 |
+——————————————————————————+
| This script is built to facilitate the NagVis installation and update |
| procedure for you. The installer has been tested on the following systems: |
| – Debian Etch, Hardy (4.0, 5.0) |
| – Ubuntu Hardy, Intrepid, Jaunty, Karmic, Lucid (8.04 to 10.04) |
| – SuSE Linux Enterprise Server 10 and 11 |
| |
| Similar distributions to the ones mentioned above should work as well. |
| That (hopefully) includes RedHat, Fedora, CentOS, OpenSuSE |
| |
| If you experience any problems using these or other distributions, please |
| report that to the NagVis team. |
+——————————————————————————+
| Do you want to proceed? [y]:
+——————————————————————————+
| Starting installation of NagVis 1.6.6 |
+——————————————————————————+
| OS : Ubuntu 12.04 LTS |
| |
+— Checking for tools ——————————————————-+
| Using packet manager /usr/bin/dpkg found |
| |
+— Checking paths ———————————————————–+
| Please enter the path to the nagios base directory [/usr/local/nagios]:
| nagios path /usr/local/nagios found |
| Please enter the path to NagVis base [/usr/local/nagvis]:
| |
+— Checking prerequisites —————————————————+
| PHP 5.3 found |
| PHP Module: gd 5.3 found |
| PHP Module: mbstring compiled_in found |
| PHP Module: gettext compiled_in found |
| PHP Module: session compiled_in found |
| PHP Module: xml compiled_in found |
| PHP Module: pdo compiled_in found |
| Apache mod_php found |
| Checking Backends. (Available: mklivestatus,ndo2db,ido2db,merlinmy) |
| Do you want to use backend mklivestatus? [y]:
| Do you want to use backend ndo2db? [n]:
| Do you want to use backend ido2db? [n]:
| Do you want to use backend merlinmy? [n]:
| Livestatus Socket (/usr/local/nagios/var/rw/live) MISSING |
| Valid socket formats are: tcp:127.0.0.1:7668 or unix:/path/to/live |
| Please enter your MKLivestatus socket: unix:/var/lib/nagios/rw/live
| Invalid socket format. Take a look above for valid formats. |
| PHP Module: sockets compiled_in found |
| Graphviz 2.26 found |
| Graphviz Module dot 2.26.3 found |
| Graphviz Module neato 2.26.3 found |
| Graphviz Module twopi 2.26.3 found |
| Graphviz Module circo 2.26.3 found |
| Graphviz Module fdp 2.26.3 found |
| SQLite 3.7 found |
| |
+— Trying to detect Apache settings —————————————–+
| Please enter the web path to NagVis [/nagvis]:
| Please enter the name of the web-server user [www-data]:
| Please enter the name of the web-server group [www-data]:
| create Apache config file [y]:
| |
+— Checking for existing NagVis ———————————————+
| |
+——————————————————————————+
| Summary |
+——————————————————————————+
| NagVis home will be: /usr/local/nagvis |
| Owner of NagVis files will be: www-data |
| Group of NagVis files will be: www-data |
| Path to Apache config dir is: /etc/apache2/conf.d |
| Apache config will be created: yes |
| |
| Installation mode: install |
| |
| Do you really want to continue? [y]:
+——————————————————————————+
| Starting installation |
+——————————————————————————+
| Creating directory /usr/local/nagvis… done |
| Creating directory /usr/local/nagvis/var… done |
| Creating directory /usr/local/nagvis/var/tmpl/cache… done |
| Creating directory /usr/local/nagvis/var/tmpl/compile… done |
| Creating directory /usr/local/nagvis/share/var… done |
| Copying files to /usr/local/nagvis… done |
| Creating directory /usr/local/nagvis/etc/profiles… done |
| Creating main configuration file… done |
| Adding MKLivestatus Backend… done |
| Adding webserver group to file_group… done |
| Creating web configuration file… done |
| Setting permissions for web configuration file… done |
| |
| |
| |
+— Setting permissions… —————————————————+
| /usr/local/nagvis/etc/nagvis.ini.php-sample done |
| /usr/local/nagvis/etc done |
| /usr/local/nagvis/etc/maps done |
| /usr/local/nagvis/etc/maps/* done |
| /usr/local/nagvis/etc/automaps done |
| /usr/local/nagvis/etc/automaps/* done |
| /usr/local/nagvis/etc/profiles done |
| /usr/local/nagvis/share/userfiles/images/maps done |
| /usr/local/nagvis/share/userfiles/images/maps/* done |
| /usr/local/nagvis/share/userfiles/images/shapes done |
| /usr/local/nagvis/share/userfiles/images/shapes/* done |
| /usr/local/nagvis/var done |
| /usr/local/nagvis/var/* done |
| /usr/local/nagvis/var/tmpl done |
| /usr/local/nagvis/var/tmpl/cache done |
| /usr/local/nagvis/var/tmpl/compile done |
| /usr/local/nagvis/share/var done |
| |
+——————————————————————————+
| Installation complete |
| |
| You can safely remove this source directory. |
| |
| For later update/upgrade you may use this command to have a faster update: |
| ./install.sh -n /usr/local/nagios -p /usr/local/nagvis -l „unix:/var/lib/nagios/rw/live“ -b mklivestatus -u www-data -g www-data -w /etc/apache2/conf.d -a y
| |
| What to do next? |
| – Read the documentation |
| – Maybe you want to edit the main configuration file? |
| Its location is: /usr/local/nagvis/etc/nagvis.ini.php |
| – Configure NagVis via browser |
| <http://localhost/nagvis/config.php> |
| – Initial admin credentials: |
| Username: admin |
| Password: admin |
+——————————————————————————+[/EXPAND]
Dateien für Troubleshooting:
Nagios Logfile:

/usr/local/nagios/var/nagios.log
/usr/local/nagios/var/status.log

Centreon Logfiles:

/usr/local/centreon/log

Nagvis Configfile:

/usr/local/nagvis/etc/nagvis.ini.php

MKLivestatus socket:

unix:/var/lib/nagios/rw/live

Pfad zu ndomod.o

/usr/local/nagios/bin/ndomod.o

Pfad zu Nagios Plugins:

/usr/local/nagios/libexec

yavdr 0.4 – Nützliche Befehle

Momentaner Stand – yaVDR in der Version 0.4. Download einer Ubuntu Installations-CD: http://www.yavdr.org/download
Hier ein paar Nützliche Befehle – und Orte wo man suchen sollte, wenn man Fehler hat:

  1. Kanal liste vergrößert sich automatisch. Bzw. neue Kanäle werden immer hinten drann gehängt
    Für Leute die mit dem Headless-Server arbeiten findet man das Config File unter /var/lib/vdr/setup.conf
    Wert: UpdateChannels = 5 (Standard)

    Einstellungen -&gt; DVB -&gt; Kanäle aktualisieren :
    * 0 kein Update
    * 1 Update der Kanal-Namen
    * 2 Update der PIDs
    * 3 Update von Kanal-Namen und PIDs
    * 4 Update von Kanal-Namen, PIDs und neu gefundenen Kanälen
    * 5 Update von Kanal-Namen, PIDs sowie neu gefundenen Kanälen und Transpondern (Standard) 
  2. Port des Streamdev-Servers ändern. Ebenfalls in /var/lib/vdr/setup.conf
    streamdev-server.AllowSuspend = 1
    streamdev-server.HTTPBindIP = 0.0.0.0
    streamdev-server.HTTPServerPort = 3000
    streamdev-server.HTTPStreamType = 0
    streamdev-server.IGMPBindIP = 0.0.0.0
    streamdev-server.IGMPClientPort = 1234
    streamdev-server.IGMPStreamType = 0
    streamdev-server.MaxClients = 20
    streamdev-server.ServerPort = 2004
    streamdev-server.StartHTTPServer = 1
    streamdev-server.StartIGMPServer = 0
    streamdev-server.StartServer = 1
    streamdev-server.SuspendMode = 1
    
  3. Streamdev Webseite mit HTTP Authentifizierung schützen.
    Dazu muss man streamdev mit zusätzlichen Startparametern starten. Die Pluginparameter kommen in folgendes Configfile (muss angelegt werden):

    /etc/vdr/plugins/plugin.streamdev-server.conf
    Inhalt: -a vdr:geheim 
  4. Prüfen ob TV-Karte erkannt wurde.
    ls /dev/dvb - Hier sollten die Geräte(adapter0, adapter1) auftauchen.
    Ansonsten nochmal im /var/log/syslog:
    May 9 10:03:07 SERVER vdr: [32095] dynamite: probing /dev/dvb/adapter1/frontend0
    May 9 10:03:07 SERVER vdr: [32095] dynamite: /dev/dvb/adapter0/frontend0 is a dvb adapter trying to set card index to 0
    May 9 10:03:07 SERVER vdr: [32095] [general.debug] capturing device 0/0 (subsystem ID 42540950)
    May 9 10:03:07 SERVER vdr: [32095] [general.debug] creating standard device 0/0
    May 9 10:03:07 SERVER vdr: [32095] new sub-device number 1
    May 9 10:03:07 SERVER vdr: [32095] frontend 0/0 provides DVB-S2 with QPSK ("Montage DS3103/TS2022")
    May 9 10:03:07 SERVER vdr: [32159] tuner on frontend 0/0 thread started (pid=32095, tid=32159)
    May 9 10:03:07 SERVER vdr: [32095] dynamite: attached device /dev/dvb/adapter0/frontend0 to dynamic device slot 1
    May 9 10:03:07 SERVER vdr: [32160] section handler thread started (pid=32095, tid=32160)
    May 9 10:03:07 SERVER vdr: [32095] dynamite: /dev/dvb/adapter1/frontend0 is a dvb adapter trying to set card index to 1
    
  5. Automatisches Suspend bzw. herunterfahren deaktivieren
    Der Eintrag sollte eindeutig sein:
    vi /etc/default/vdr
    # Change this to 1 if you want vdr to be able to shutdown the
    # computer
    ENABLE_SHUTDOWN=0
    
  6. Ring Buffer overflows vermeiden – Buffer erhöhen
    Dazu müssen die Plugins bzw. der VDR neu kompiliert werden. Am besten direkt an die Anleitung halten: http://goo.gl/MOQ32
    Folgende Dateien müssen geändert werden:

    vdr/vdr-1.7.22/recorder.c

    define RECORDERBUFSIZE (MEGABYTE(500) / TS_SIZE * TS_SIZE) // multiple of TS_SIZE

    vdr/vdr-1.7.22/dvbplayer.c

    #define PLAYERBUFSIZE MEGABYTE(100)

    vdr-plugin-xvdr-0.9.5/src/live/livestreamer.c

     , cRingBufferLinear(MEGABYTE(500), TS_SIZE*10, true)
  7. Signalstärke mittels Femon Plugin in der Shell anzeigen lassen.
    Vorraussetzung: vdr-plugin-femon ist installiert.
    svdrpsend -d localhost -p 6419 PLUG femon INFO
    220 SERVER SVDRP VideoDiskRecorder 1.7.22; Wed Jun 13 09:11:43 2012; UTF-8
    900-CARD:0
    900-STRG:65
    900-QUAL:64
    900-TYPE:0
    900-NAME:Montage DS3103/TS2022
    --------------------------------
    oder das INFO am Ende weglassen, für Anzeige der Befehle:
    220 SERVER SVDRP VideoDiskRecorder 1.7.22; Wed Jun 13 09:13:49 2012; UTF-8
    214-Plugin femon v1.7.11 - DVB Signal Informationsanzeige (OSD)
    214-SVDRP commands:
    214-    OPEN      QUIT      NEXT      PREV      INFO
    214-    NAME      STAT      STRG      QUAL      SGNL
    214-    SNRA      BERA      UNCB      VIBR      AUBR
    214-    DDBR
    214 End of HELP info
    221 SERVER closing connection