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 … Read More
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” … Read More
so i was doing some misc work on one of my machines the other day and as i was working i kept having this service restarting even though i kind of needed it on but at the time i needed it off. so i wrote this stupid little find, message and kill script to cron … Read More
i wrote this little quick script to backup my script folder from all my workstations and keep them in one repository (i know that there are better and probably easier ways of doing this). edit 26-apr-2008 changed some checks in script #!/bin/bash # # rsync script for backups # script assumes that you have all … Read More
here is a simple snippet to use your nokia 9300i as a modem assuming you have all the right bluetooth tools on your machine. this script was only tested with gentoo, not that it would make any difference: #!/bin/bash # this script runs as either root or sudo – # this script connects to a … Read More
here is a simple snippet to mount your nokia 9300i as a drive assuming you have all the right bluetooth tools on your machine. this script was only tested with gentoo, not that it would make any difference, keep in mind this script is still being modified and tested so i guarantee nothing. this script … Read More
from using strace (thanks mike), i have learned that its easier to just have a makeshift wrapper for it that will automatically handle all the fun and dirty stuff for you (not that there is much). #!/bin/bash # debug strace wrapper # saves output to temp in the form of /tmp/$1.$$ # “/path/to/command” can be … Read More
this is a simple html/php page for showing commands from the line in a browser. use it as a template for whatever you need. <html> <head> <title></title> <body> <form method=GET> <input type=”radio” name=”choice” value=”1″>uptime<br> <input type=”radio” name=”choice” value=”2″>whoami<br> <input type=”radio” name=”choice” value=”3″>df -h<br> <input type=”radio” name=”choice” value=”4″>du -h<br> <input type=”radio” name=”choice” value=”5″>ps -ef<br> <input type=”radio” … Read More
this is a simple little script to count the errors and other things out put over snmp during the course of one minute. i didnt leave the output portion of this script on the bottom of it since i was using it for a couple of different things. #!/bin/bash -x # count is a “counter” … Read More
i am posting a quick mrtg cfg file which will check for free memory, cpu usage, swap, tcp connections and oracle connections. these were tested with solaris 10, various linux distros and snmp v1. ## specify mrtg workdir ## WorkDir: <work dir> RunAsDaemon: Yes ## interval for mrtg can not be set to less than … Read More