another stupid nagios process checker 

here is another in the long line of stupid scripts for nagios.

this script finds specific process, then counts them and spits out an error level according to setting

enjoy!!
#!/bin/bash

## replace "ORA_" with some other unique identifier
## from vi :1,$s/ORA_/"unique"/g
ORA_TEMP=/tmp/ora_procs.tmp
## replace "ora_" with what you need grep'ed
ps -ef | awk '/ora_/ && !/awk/ {print $8}' >${ORA_TEMP}
ORA_COUNT=`cat ${ORA_TEMP} | wc -l`

if [ ${ORA_COUNT} -gt 0 ]; then
## change ge & le to what is needed
if [ ${ORA_COUNT} -ge 6 ] && [ ${ORA_COUNT} -le 15 ]; then
printf "${ORA_COUNT} proc(s) counted\n"
echo exit 1
## change ge & le to what is needed
if [ ${ORA_COUNT} -ge 1 ] && [ ${ORA_COUNT} -le 5 ]; then
printf "${ORA_COUNT} proc(s) counted\n"
## exit 0 - ok for nagios
echo exit 2
fi
else
printf "${ORA_COUNT} proc(s) counted\n"
## exit 0 - ok for nagios
echo exit 0
fi
else
## replace the word "ORACLE" with whatever it is you are monitoring
printf "${ORA_COUNT} proc(s) counted\n - ORACLE is not running!!!"
## exit 2 - critical for nagios
echo exit 2
fi

[ add comment ] ( 3 views ) [ 0 trackbacks ] permalink ( 0 / 0 )
nice view 

080626 14:45:35 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.000015' at position 3370, relay log './dbase-relay-bin.000002' position: 235
080626 14:45:35 [Note] Slave I/O thread: connected to master 'slave@10.0.0.1:3306', replication started in log 'mysql-bin.000015' at position 3370
....that makes me feel better....
[ add comment ] ( 11 views ) [ 0 trackbacks ] permalink ( 2.9 / 7 )
simple mysql show table status script 

all this little script is doing is measuring Data_length used by dividing it by Max_data_length so it can give us a clean number that will be usable for monitoring.

this is still a very dirty script so there will be updates:
#!/bin/bash
FILE_OUT=/tmp/data_out.txt
DB_NAME=eyf
DB_USERNAME=user
DB_PASSWORD=password

function warn_db_info {
awk '{print $1, $7, $8}'| awk '!/NULL/ && !/Name/ {printf "%-25s %7.7f\n", $1, $2/$3}' | awk '{if (NF == 2 && $2 >= .7500000 && $2 <= .9499999) printf "%-25s %7.7f\n", $1, $2}'
}

function crit_db_info {
awk '{print $1, $7, $8}'| awk '!/NULL/ && !/Name/ {printf "%-25s %7.7f\n", $1, $2/$3}' | awk '{if (NF == 2 && $2 >= .9500000) printf "%-25s %7.7f\n", $1, $2}'
}

printf "stats for ${DB_NAME}\n" >> ${FILE_OUT}
printf "more than .7500000 but less than .9499999\n" >>${FILE_OUT}
echo "show table status" | mysql -u${DB_USERNAME} db_${DB_NAME}_alumn -p${DB_PASSWORD} | warn_db_info >>${FILE_OUT}
printf "\n" >>${FILE_OUT}
printf "more than .9500000 up to 1.0000000\n" >>${FILE_OUT}
echo "show table status" | mysql -u${DB_USERNAME} db_${DB_NAME}_alumn -p${DB_PASSWORD} | crit_db_info >>${FILE_OUT}
printf "\n" >>${FILE_OUT}

[ add comment ] ( 11 views ) [ 0 trackbacks ] permalink ( 3 / 5 )
simple nagios port check 

here is a simple little nagios script to check the status of a port with ouput - sounds stupid but i needed it to check 2 specific ports for ouput and it works.
#!/bin/bash
if [ -z $2 ]; then
if [ -z $1 ]; then
printf "needs \$1 & \$2 (address & port number)\n"
exit 2
else
printf "needs \$2 (port number)\n"
exit 2
fi
fi

function port {
if [ $? -ne 0 ] ; then
printf "warning: "
if [ $? -eq 6 ]; then
echo "cant resolve host - check dns"
exit 2
fi
if [ $? -eq 7 ]; then
echo "cant connect to host"
exit 2
fi
printf "port may be closed\n"
else
printf "port is open\n"
exit 0
fi
}
curl -s -o "/dev/null" ${1}:${2}
## -o writes output to file instead of stdout
## -s runs silent mode
port;
syntax: port_check.sh <address of machine> <port>

simple enough right ??
[ add comment ] ( 15 views ) [ 0 trackbacks ] permalink ( 2.8 / 12 )
*** firesale *** 

68th annual pissedoffadmins.com firesale and chutney cyberspace bbq



anouncing the second 68th annual pissedoffadmins firesale.

after the non-success of last years, i figured lets do it again.
but this time, lets run it the whole month of june.

some of the items up for grab this year are:
thinkpad t42p with tons of stickers (working and decked out)
alinco radio (working)
ramsey electronics frequency counter (working with charger)
possibly the MVME from previous posts (working)
an old and working civil defense geiger counter
possibly a series one oqo running linux (working and decked out)
a ps2 with a bunch of games (working)
old sony 17" monitor (working)
possibly nonworking sgi1600sw
...and so much more!!!
****this list will be updated frequently****
email me for specs and prices


here is the catch:
i am not shipping any of these items.
if you want them you arrange with me to pick them up.
arrangements will include some awesome non-exisstant chutney and you get 5 minutes to party with yasser the goat (yes, a party goat)

[ add comment ] ( 19 views ) [ 0 trackbacks ] permalink ( 3 / 10 )
geek humor...... of sorts 

so i was talking to mike the other day and this is the what he states about his code:

mike s 
back
thanks :D
i like my code like i like my women
tight, clean, black and white and full of hash marks
err ... covered in comments?
hmm....
i'll work on that for next time


....straight from the naim logs.......
[ add comment ] ( 517 views ) [ 0 trackbacks ] permalink ( 2.7 / 11 )
SGI Fuel images 

here are a couple of pictures of the sgi fuel. the images are not all that great but i dont really care.

*** pictures are of the actual unit and are huge for detail ***
front
rear label
ram / air vent

i might post more.

[ add comment ] ( 603 views ) [ 0 trackbacks ] permalink ( 3 / 16 )
new machine - sgi fuel 

here is a new machine added to the home farm:

SGI Fuel
specs:
$ hinv -m       
IP34 Board: barcode MMN903 part 030-1707-003 rev -H
IP34PIMM Board: barcode NCH850 part 030-1730-002 rev -E
ASTODYV10 Board: barcode NSR614 part 030-1826-003 rev -A
1 600 MHZ IP35 Processor
CPU: MIPS R14000 Processor Chip Revision: 2.4
FPU: MIPS R14010 Floating Point Chip Revision: 2.4
Main memory size: 2048 Mbytes
Instruction cache size: 32 Kbytes
Data cache size: 32 Kbytes
Secondary unified instruction/data cache size: 4 Mbytes
Integral SCSI controller 0: Version QL12160, low voltage differential
Disk drive: unit 1 on SCSI controller 0
Integral SCSI controller 1: Version QL12160, single ended
CDROM: unit 6 on SCSI controller 1
IOC3/IOC4 serial port: tty1
IOC3/IOC4 serial port: tty2
IOC3 parallel port: plp1
Graphics board: V10
Integral Fast Ethernet: ef0, version 1, module 001c01, pci 4
USB controller: type OHCI

$ uname -aR
IRIX64 venus 6.5 6.5.30m 07202013 IP35
....bad ass....

pictures coming soon....
[ add comment ] ( 33 views ) [ 0 trackbacks ] permalink ( 3 / 10 )

| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Next> Last>>