Vim bietet viele Konfigurationsmöglichkeiten. Und da es noch nicht genug Seiten im Inet gibt, dachte ich mir, auch mal meine .vimrc zu veröffentlichen
Den Rest des Beitrags lesen »
Mit ‘Sysadmin’ getaggte Artikel
.vimrc
Geschrieben von alexs77 - 30. Dezember 2011
Veröffentlicht in Arbeit, Computerzeuchs, Linux, Solaris | Getaggt mit: Linux, Solaris, Sysadmin, Unix, vim | Kommentar schreiben »
Windows 7 USB Stick unter LINUX erstellen
Geschrieben von alexs77 - 27. November 2011
WINDOWS 7 USB STICK UNTER LINUX ERSTELLEN
Von http://krz.ch/A7tz bzw. http://funrecycler.com/2010/10/14/windows-7-usb-stick-unter-linux-erstellen/
Um mit DIESER Anleitung einen Windows 7 bootfähigen USB-Stick unter Linux zu erstellen wird folgendes benötigt:
1. Linux System
2. MS-sys
3. GParted
4. Windows 7 Image Datei
5. USB-Stick > 4GB
1)
Installiere das Tool GParted aus den offiziellen Quellen (falls noch nicht im System vorhanden) und formatiere
den USB-stick auf NTFS und markiere ihn als “bootable” (rechte Maustaste auf auf die neu erstellte Partition
und ein Haken bei “boot” setzten).
GParted hat seinen Dienst getan und kann beendet werden.
2)
Binde Dein Windows 7 Image ins Dateisystem ein und kopiere den kompletten Inhalt oder extrahiere das Image
direkt auf den USB-Stick.
3)
Lade Das Packet MS-sys [Quelle: http://sourceforge.net/projects/ms-sys/files/ms-sys%20stable/2.2.1/ms-sys-2.2.1.tar.gz/download ]
herunter und entpacke es in einen belieben Ordner.
Anschließend öffnest Du ein Terminal und navigierst in den entpackten Ordner:
cd /mein/ordner/zum/entpackten/ms-sys-2.2.1 [enter]
Um MS-sys zu installieren gehe folgendermaßen vor:
make [enter]
sudo make install [enter]
MS-sys ist nun ins System integriert und kann verwendet werden.
Zu guter letzt muß nun MS-sys verwendet werden um auf dem USB-Stick mit den Windows 7 Imagedateien einen
Microsoft konformen Bootloader zu erstellen.
ms-sys -7 /dev/sdX [enter] (sdX entspricht dem Synonym des USB Laufwerk Pfades z.B.: /dev/sdb)
4)
Das erstellen des Windows 7 USB Sticks ist nun abgeschloßen. Starte nun Dein System neu, setze im BIOS
die Option das von USB gebootet werden kann und boote anschließend das Windows 7 Setup vom USB-Stick.
Veröffentlicht in Computerzeuchs, Linux | Getaggt mit: Linux, Sysadmin, Windows | Kommentar schreiben »
Nagios/Icinga: Veritas NetBackup Volume Pool Check Plug-In
Geschrieben von alexs77 - 9. Oktober 2009
To monitor the number of available tapes in a “Volume Pool” of our Symantec/Veritas NetBackup installation, I was looking for a “Plug-In” for Nagios/Icinga. And on “Jurry’s Blog“, I found a sample script, which I “enhanced” a bit.
Veröffentlicht in Arbeit, Computerzeuchs | Getaggt mit: #ftw, English, Nagios, Solaris, Solaris 10, Sysadmin, Unix | Kommentar schreiben »
Installing Nagios / Icinga
Geschrieben von alexs77 - 25. September 2009
After having installed the depencency libraries, now Nagios has to be installed.
Nagios Core
First of all, the current version of Nagios Core (ie. 3.2.0) has to be fetched and unpacked. We’ll also need to apply a patch to fix the issues shown in the Icinga Installation Troubles post.
Run the following “script” to download, compile and install (using sudo) Nagios 3.2.0 (yes, it’s indeed one humongous line. You can paste it exactly like it is shown into a terminal):
src_url=http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.2.0.tar.gz && \
patch_url=http://esisteinfehleraufgetreten.s3.amazonaws.com/nagios/fix-nagios-3.2.0.patch && \
gnu_patch=$(which gpatch) && \
src_dir=$HOME/src/$(basename $src_url .tar.gz) && \
\
mkdir -p $HOME/src && cd $HOME/src && \
(
if [[ -r $HOME/src/$(basename $src_url) ]];
then cat $HOME/src/$(basename $src_url)
else wget -qO- $src_url | tee $HOME/src/$(basename $src_url)
fi
) | gzcat | tar xf - && \
(
if [[ -r $HOME/src/$(basename $patch_url) ]];
then cat $HOME/src/$(basename $patch_url)
else wget -qO- $patch_url | tee $HOME/src/$(basename $patch_url)
fi
) | $gnu_patch -d $src_dir -p1 && \
test -L $src_dir/base/snprintf.o || ln -s ../common/snprintf.o $src_dir/base && \
\
cd $src_dir && \
\
CFLAGS="-fast -xtarget=sparc64vii -xarch=sparcima -xchip=sparc64vii -xcache=64/64/2:5120/256/10 -xautopar -fma=fused -xipo=2 -zlazyload" \
CC=/opt/sunstudio12.1/bin/cc \
PATH=/opt/sunstudio12.1/bin:/usr/sfw/bin:/usr/xpg6/bin:/usr/xpg4/bin:/usr/openwin/bin:/usr/X11/bin:/usr/bin:/usr/sbin:/usr/ucb \
LDFLAGS=-R/opt/local/lib \
~+/configure --prefix=/opt/local/nagios-3.2.0 \
--enable-nanosleep --enable-statusmap --with-perlcache --enable-statuswrl \
--with-gd-lib=/opt/local/lib --with-gd-inc=/opt/local/include \
--with-cgiurl=/cgi-bin/nagios-3.2.0 --with-htmurl=/nagios-3.2.0 \
--with-nagios-user=$(id -un) --with-nagios-group=$(id -gn) \
--with-init-dir=\${prefix}/etc/init.d --with-httpd-conf=\${prefix}/etc/apache && \
\
CFLAGS="-fast -xtarget=sparc64vii -xarch=sparcima -xchip=sparc64vii -xcache=64/64/2:5120/256/10 -xautopar -fma=fused -xipo=2 -zlazyload" \
CC=/opt/sunstudio12.1/bin/cc \
PATH=/opt/sunstudio12.1/bin:/usr/sfw/bin:/usr/xpg6/bin:/usr/xpg4/bin:/usr/openwin/bin:/usr/X11/bin:/usr/bin:/usr/sbin:/usr/ucb \
LDFLAGS=-R/opt/local/lib \
make all && \
\
sudo sh -c '
make install && make install-init && make install-commandmode && make install-config && make install-webconf
'
SMF Manifest
In order to be able to manage (start, stop, control) Nagios with SMF, there needs to be a manifest for Nagios which has to be imported to the system.
url=http://esisteinfehleraufgetreten.s3.amazonaws.com/nagios/application-nagios.manifest.xml
wget -P /tmp $url && \
sudo svccfg import /tmp/$(basename $url)
Icinga
Instead of Nagios Core, it should be possible to use Icinga instead.
src_url=http://prdownloads.sourceforge.net/sourceforge/icinga/icinga-0.8.4.tar.gz && \
patch_url=http://esisteinfehleraufgetreten.s3.amazonaws.com/nagios/fix-icinga-0.8.4.patch && \
gnu_patch=$(which gpatch) && \
src_dir=$HOME/src/$(basename $src_url .tar.gz) && \
\
mkdir -p $HOME/src && cd $HOME/src && \
(
if [[ -r $HOME/src/$(basename $src_url) ]];
then cat $HOME/src/$(basename $src_url)
else wget -qO- $src_url | tee $HOME/src/$(basename $src_url)
fi
) | gzcat | tar xf - && \
(
if [[ -r $HOME/src/$(basename $patch_url) ]];
then cat $HOME/src/$(basename $patch_url)
else wget -qO- $patch_url | tee $HOME/src/$(basename $patch_url)
fi
) | $gnu_patch -d $src_dir -p1 && \
test -L $src_dir/base/snprintf.o || ln -s ../common/snprintf.o $src_dir/base && \
\
cd $src_dir && \
\
CFLAGS="-fast -xtarget=sparc64vii -xarch=sparcima -xchip=sparc64vii -xcache=64/64/2:5120/256/10 -xautopar -fma=fused -xipo=2 -zlazyload" \
CC=/opt/sunstudio12.1/bin/cc \
PATH=/opt/sunstudio12.1/bin:/usr/sfw/bin:/usr/xpg6/bin:/usr/xpg4/bin:/usr/openwin/bin:/usr/X11/bin:/usr/bin:/usr/sbin:/usr/ucb \
LDFLAGS=-R/opt/local/lib \
~+/configure --prefix=/opt/local/icinga-0.8.4 \
--enable-nanosleep --enable-statusmap --with-perlcache --enable-statuswrl \
--with-gd-lib=/opt/local/lib --with-gd-inc=/opt/local/include \
--with-cgiurl=/cgi-bin/icinga-0.8.4 --with-htmurl=/icinga-0.8.4 \
--with-icinga-user=$(id -un) --with-icinga-group=$(id -gn) \
--with-init-dir=\${prefix}/etc/init.d --with-httpd-conf=\${prefix}/etc/apache && \
\
CFLAGS="-fast -xtarget=sparc64vii -xarch=sparcima -xchip=sparc64vii -xcache=64/64/2:5120/256/10 -xautopar -fma=fused -xipo=2 -zlazyload" \
CC=/opt/sunstudio12.1/bin/cc \
PATH=/opt/sunstudio12.1/bin:/usr/sfw/bin:/usr/xpg6/bin:/usr/xpg4/bin:/usr/openwin/bin:/usr/X11/bin:/usr/bin:/usr/sbin:/usr/ucb \
LDFLAGS=-R/opt/local/lib \
make all && \
\
sudo sh -c '
make install && make install-init && make install-commandmode && make install-config && make install-webconf
'
SMF Manifest
Exactly like with Nagios Core, there needs to be SMF Manifest for Icinga. Install it:
url=http://esisteinfehleraufgetreten.s3.amazonaws.com/nagios/application-icinga.manifest.xml
wget -P /tmp $url && \
sudo svccfg import /tmp/$(basename $url)
Nagios Plugins
After having installed Nagios Core, it’s now time to turn to the Nagios Plugins. At the time of this writing, v1.4.13 is the current stable version. The plugins need to be installed in the same directory, where Nagios Core is installed (an alternative might be to fix/change the supplied default configuration to point to the installation directory of Nagios Plugins).
src_url=http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.13.tar.gz && \
gnu_patch=$(which gpatch) && \
\
mkdir -p $HOME/src && cd $HOME/src && \
(
if [[ -r $HOME/src/$(basename $src_url) ]];
then cat $HOME/src/$(basename $src_url)
else wget -qO- $src_url | tee $HOME/src/$(basename $src_url)
fi
) | gzcat | tar xf - && \
\
cd $HOME/src/$(basename $src_url .tar.gz) && \
\
CFLAGS="-fast -xtarget=sparc64vii -xarch=sparcima -xchip=sparc64vii -xcache=64/64/2:5120/256/10 -xautopar -fma=fused -xc99=all -xipo=2 -zlazyload" \
CC=/opt/sunstudio12.1/bin/cc CXX=/opt/sunstudio12.1/bin/CC \
PATH=/opt/sunstudio12.1/bin:/usr/sfw/bin:/usr/xpg6/bin:/usr/xpg4/bin:/usr/openwin/bin:/usr/X11/bin:/usr/bin:/usr/sbin:/usr/ucb:/export/home/webservd/flexlm/UGS/Teamcenter2005/Visualization/bin \
LDFLAGS="-R/opt/local/lib -R/usr/sfw/lib -L/usr/sfw/lib" \
~+/configure --prefix=/opt/local/nagios-3.2.0 \
--with-nagios-user=$(id -un) --with-nagios-group=$(id -gn) \
--with-cgiurl=/cgi-bin/nagios-3.2.0 \
--with-trusted-path=/bin:/sbin:/usr/bin:/usr/sbin:/usr/sfw/bin:/usr/xpg6/bin:/usr/xpg4/bin:/usr/openwin/bin:/usr/X11/bin:/opt/csw/bin:/opt/csw/sbin \
\
--with-ping-command="/usr/sbin/ping -s %s 64 %u" --without-ipv6 \
--with-nslookup-command=/usr/sbin/nslookup --with-uptime-command=/bin/uptime \
--with-dig-command=/usr/sbin/dig --with-ssh-command=/usr/bin/ssh \
\
--with-mysql=/usr/sfw --with-openssl=/usr/sfw && \
\
CFLAGS="-fast -xtarget=sparc64vii -xarch=sparcima -xchip=sparc64vii -xcache=64/64/2:5120/256/10 -xautopar -fma=fused -xc99=all -xipo=2 -zlazyload" \
CC=/opt/sunstudio12.1/bin/cc CXX=/opt/sunstudio12.1/bin/CC \
PATH=/opt/sunstudio12.1/bin:/usr/sfw/bin:/usr/xpg6/bin:/usr/xpg4/bin:/usr/openwin/bin:/usr/X11/bin:/usr/bin:/usr/sbin:/usr/ucb:/export/home/webservd/flexlm/UGS/Teamcenter2005/Visualization/bin \
LDFLAGS="-R/opt/local/lib -R/usr/sfw/lib -L/usr/sfw/lib" \
make && \
\
sudo make install
SysAdmin’s Journey has these additional ps(1) related configure options:
--with-ps-command="/bin/ps -eo 's uid pid ppid vsz rss pcpu etime comm args'" \
--with-ps-format='%s %d %d %d %d %d %f %s %s %n' \
--with-ps-cols=10 \
--with-ps-varlist='procstat,&;procuid,&;procpid,&;procppid,&;procvsz,&;procrss,&;procpcpu,procetime,procprog,&pos'
When I add those, make ultimately fails with:
source='check_procs.c' object='check_procs.o' libtool=no \
DEPDIR=.deps depmode=none /bin/bash ../build-aux/depcomp \
/opt/sunstudio12.1/bin/cc -DLOCALEDIR=\"/opt/local/nagios-plugins-1.4.13/share/locale\" -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I../lib -I../gl -I../intl -I/usr/include/pgsql -I/usr/sfw/include -I/usr/sfw/include -fast -xtarget=sparc64vii -xarch=sparcima -xchip=sparc64vii -xcache=64/64/2:5120/256/10 -xautopar -fma=fused -xc99=all -xipo=2 -zlazyload -c check_procs.c
"check_procs.c", line 185: syntax error before or at: ;
"check_procs.c", line 185: syntax error before or at: ;
"check_procs.c", line 185: syntax error before or at: ;
"check_procs.c", line 185: syntax error before or at: ;
"check_procs.c", line 185: syntax error before or at: ;
"check_procs.c", line 185: syntax error before or at: ;
"check_procs.c", line 185: syntax error before or at: )
cc: acomp failed for check_procs.c
*** Error code 1
make: Fatal error: Command failed for target `check_procs.o'
Current working directory /export/home/webservd/src/nagios-plugins-1.4.13.failing/nagios-plugins-1.4.13/plugins
Dunno how Justin got nagios-plugins to compile with these flags; I suppose it’s because he used an older version of nagios-plugins. Anyway, he writes, that he HAD to use these flags, otherwise, make would error out on him in check_procs. For me, it’s the opposite – don’t use --with-ps-XYZ flags, and it compiles fine. Use those --with-ps-XYZ flags, and make fails.
Start
Nagios
Now, after having installed BOTH Nagios Core and Nagios Plugins, it should be possible to start application/nagios:
$ svcs application/nagios
STATE STIME FMRI
disabled 9:12:23 svc:/application/nagios:default
$ sudo svcadm enable -s application/nagios
$ svcs application/nagios
STATE STIME FMRI
maintenance 9:12:38 svc:/application/nagios:default
Reviewing the log file /var/svc/log/application-nagios:default.log shows this fault:
[...]
[ Sep 29 09:12:37 Executing start method ("/opt/local/nagios-3.2.0/etc/init.d/nagios start") ]
Starting nagios: done.
[ Sep 29 09:12:37 Method "start" exited with status 0 ]
[ Sep 29 09:12:37 Stopping because process dumped core. ]
[ Sep 29 09:12:37 Executing stop method ("/opt/local/nagios-3.2.0/etc/init.d/nagios stop") ]
Stopping nagios: done.
[ Sep 29 09:12:37 Method "stop" exited with status 0 ]
[...]
Main fault: “Stopping because process dumped core.“. Interestingly, when trying to start nagios manually (by running /opt/local/nagios-3.2.0/etc/init.d/nagios start), Nagios starts up just fine – please also see the blogpost Core Dumps when run in SMF, fine otherwise‽.
Haven’t found a reason for the core dump (and also have NOT found the core core dump file itself by running find / -type f -name core, for that matter…). Because of that, switching to the OpenCSW Nagios “Core” and Nagios Plugins packages.
For the self compiled stuff, this is a:
#fail
Icinga
Try to start icinga:
$ svcs icinga
STATE STIME FMRI
disabled 10:21:42 svc:/application/icinga:default
$ sudo svcadm enable -s svc:/application/icinga:default
svcadm: Instanz "svc:/application/icinga:default" befindet sich im Wartungszustand.
$ svcs icinga
STATE STIME FMRI
maintenance 10:22:24 svc:/application/icinga:default
And just like Nagios, icinga fails as well:
[...]
[ Sep 29 10:25:30 Executing start method ("/opt/local/icinga-0.8.4/etc/init.d/icinga start") ]
-n Starting icinga:
done.
[ Sep 29 10:25:30 Method "start" exited with status 0 ]
[ Sep 29 10:25:30 Stopping because process dumped core. ]
[ Sep 29 10:25:30 Executing stop method ("/opt/local/icinga-0.8.4/etc/init.d/icinga stop") ]
Stopping icinga: done.
[...]
Like I said:
#fail
Veröffentlicht in Arbeit, Computerzeuchs | Getaggt mit: Icinga, Nagios, SMF, Solaris, solaris10, Sysadmin | Kommentar schreiben »
Core Dumps when run in SMF, fine otherwise‽
Geschrieben von alexs77 - 24. September 2009
I discovered, that my self compiled version of Nagios 3.2.0 core dumps, when I run it using the Solaris SMF facility. But when I run it manually, everything’s fine. Strange…
After VERY shortly “trying out” Icinga, I changed by mind, and decided to go the more stable road and installed Nagios. As there’s only an “ancient” version of 3.0.6 available at OpenCSW in their “Current Tree” at the time of this writing, I went ahead and downloaded the now up-to-date version 3.2.0 from Nagios and installed it. This also involved installing libjpeg, libpng, FreeType and finally gd.
Veröffentlicht in Arbeit | Getaggt mit: #fail, Nagios, SMF, Solaris, solaris10, Sysadmin | 3 Kommentare »
Installing dependency libraries for Nagios/Icinga
Geschrieben von alexs77 - 24. September 2009
Nagios and also Icinga require that the GD library is present; libgd in turn requires libpng, libjpeg and FreeType to be there. For reference, here’s how those packages have been compiled on „my“ Solaris 10 5/09 Sparc M4000 system using Sun Studio 12.1.
Overview
All the sources are to be compiled using Sun Studio and everything is to be installed underneath /opt/local. Code should, generally, be compiled with compiler flags (CFLAGS) set to a value, which generate the best performance. Ie.:
Den Rest des Beitrags lesen »
Veröffentlicht in Arbeit, Computerzeuchs | Getaggt mit: Icinga, Nagios, Solaris, Solaris 10, Sysadmin | 1 Kommentar »