Skip to content

Instantly share code, notes, and snippets.

View jhrcz's full-sized avatar

Jan Horacek jhrcz

View GitHub Profile
@jhrcz
jhrcz / README.md
Last active December 18, 2015 18:18

teplate for check_cluster nagios check

scripted in bash for easy reusing

sample output

$ cat my-hostprefix-clu-host-GEN.cfg my-hostprefix--clu-services-GEN.cfg my-hostprefix-clu-deps-GEN.cfg 
@jhrcz
jhrcz / hostdiff-dir.sh
Created June 20, 2013 12:55
lame comparing of remote hosts (files/dirs)
vimdiff <( echo "##### $1 #####" ; ssh root@$1 ls -l $3 | sort -k9 ) <( echo "##### $2 ##### ; ssh root@$2 ls -l $3 | sort -k9 )
@jhrcz
jhrcz / README.md
Last active December 18, 2015 04:49

real world example of check-pkgswithoutrepo.sh

it is important to note, that this is slooooow. i think about some sort of asynchronicity

# time bash check-out-of-repos.sh
FAILED, 8 packages without repos found:  etnpol-tomcat-5.5.23-mysql-5.5.23-6.noarch git-1.8.0.1-1.jhr.1.el6.x86_64 etnpol-tomcat-5.5.23-log4j-5.5.23-6.noarch etnpol-tomcat-5.5.23-5.5.23-6.noarch perl-Git-1.8.0.1-1.jhr.1.el6.noarch percona-release-0.0-1.x86_64 etnpol-tomcat-5.5.23-core-5.5.23-6.noarch nagios-plugin-check-bindmounts-0.1.00.snap.20130307.115442.git.7b7b268-0.el6.noarch

real	5m32.469s

struktura wiki namesapec a stranek

 *-- start
 |
 *-- sekceA
 |      *--subsekce1
 |      |`-subsekce2
 | `-subsejce3
@jhrcz
jhrcz / nagios-timestamp-conver.sh
Created May 28, 2013 09:31
useful pipe tool for converting timestamps in nagios log to human readable format
perl -pe 's/(\d+)/localtime($1)/e'
# hotfix for this issue:
# X11 connection rejected because of wrong authentication
# debug2: X11 connection uses different authentication protocol.
#
# credits go to contributors in this bugzilla entry:
# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=49944
#
n=$(xauth list | grep unix:"$(echo $DISPLAY | cut -d : -f 2 | cut -d . -f 1)" | sed -e 's,/unix:,:,')
echo "INFO: $n"

apache-tomcat-packages-testing-notes

rctc init-user tomcat55
rctc init-user tomcat60
rctc init-user tomcat70

rctc kill tomcat55
rctc kill tomcat60

java testing

( /usr/bin/etnpol-sun-java-1.6.0-env-vars.sh ; echo java -version ) | bash -ls 2>&1 | grep 'java version "1.6.0_' && echo OK || echo FAIL
( /usr/bin/etnpol-sun-java-1.7.0-env-vars.sh ; echo java -version ) | bash -ls 2>&1 | grep 'java version "1.7.0_' && echo OK || echo FAIL
to much depends over paradise....
mod_authnz_crowd od atlassianu
original package....
[root@etn-twinstone-1 ~]# yum install mod_authnz_crowd-2.0.1-1.el6.x86_64.rpm
Loaded plugins: changelog, downloadonly, etckeeper, priorities, security, versionlock
base | 3.7 kB 00:00
@jhrcz
jhrcz / nrpe-checkrun-example.md
Last active December 16, 2015 22:30
nrpe-checkrun example

running check against remote host (useful for testing from central nagios server)

# nrpe-checkrun check_load server.domain.xxx
OK - load average: 3.40, 2.51, 2.51|load1=3.400;15.000;30.000;0; load5=2.510;10.000;25.000;0; load15=2.510;5.000;20.000;0; 

running on server for checking nrpe configuration

# nrpe-checkrun check_disk_all
DISK OK - free space: / 10911 MB (82% inode=92%); /dev/shm 1003 MB (100% inode=99%); /boot 18 MB (20% inode=99%);| /=2392MB;12614;13315;0;14016 /dev/shm=0MB;902;952;0;1003 /boot=73MB;86;91;0;96