Operating System - Linux
1753826 Members
8629 Online
108805 Solutions
New Discussion юеВ

Re: SYSTEM TOOLS: What scripts have you developed for system administration?

 
SOLVED
Go to solution
TheJuiceman
Super Advisor

SYSTEM TOOLS: What scripts have you developed for system administration?

I'm curious to see what everyone has come up with for monitoring their systems. Give us your best stuff!!! I will be awarding points. Thanks.
3 REPLIES 3
VK2COT
Honored Contributor
Solution

Re: SYSTEM TOOLS: What scripts have you developed for system administration?

Hello,

Here is a script that I use daily.
I update it regularly and I think
I got rid of most bugs in
the code :)

So far it helped me during many upgrades and server release-to-production:

http://www.circlingcycle.com.au/Unix-sources/HP-UX-check-OAT.pl.txt

Almost 200 tests are run in the Perl script.

I used it on hardware as large as
SuperDomes down to small workstations.

All you need is at least Perl 5.6.1.

Regards,

VK2COT
VK2COT - Dusan Baljevic
James R. Ferguson
Acclaimed Contributor

Re: SYSTEM TOOLS: What scripts have you developed for system administration?

Geoff Wild
Honored Contributor

Re: SYSTEM TOOLS: What scripts have you developed for system administration?

There's a lot in the links that James gave you...


Here's a little script I use called lpst

# cat /opt/hpnpl/bin/lpst
#!/bin/sh
#
# check printer status
# Geoff Wild

if [ $# -lt 1 -o \( $# -gt 1 -a $# -lt 4 \) ]
then
echo "Usage:"
echo "lpst \"printer\""
echo "Example:"
echo "lpst W052"
exit 1
fi
echo " "
/usr/sbin/ping $1 -n 2
echo " "
lpstat -p$1 -v$1
echo " "
echo "Output Requests"
echo "-----------------------------------------------------------"
lpstat -o$1
echo " "
lpstat -r
echo " "

Output like so:

# lpst W052

PING pcr12169.mydomain.net: 64 byte packets
64 bytes from 192.168.163.184: icmp_seq=0. time=6. ms
64 bytes from 192.168.163.184: icmp_seq=1. time=6. ms

----pcr12169.mydomain.net PING Statistics----
2 packets transmitted, 2 packets received, 0% packet loss
round-trip (ms) min/avg/max = 6/6/6

printer W052 is idle. enabled since Jul 19 11:32
fence priority : 0
device for W052: /dev/null

Output Requests
-----------------------------------------------------------
no entries

Here's a little script to check all your lan cards:

# cat /usr/local/bin/lancards
#!/usr/bin/sh
# script to check speed and settings of lan cards
PATH=/usr/sbin:/usr/bin
ppas=`lanscan | awk '$3~/^[0-9]$/{print $3}' | xargs`
for i in $ppas
do
printf "Card at PPA %s - " $i
ipa=`ifconfig lan${i} 2>/dev/null | awk '{ip=$2}END{if(ip==""){printf("Not assigned")}else{printf("%s ",ip)}}'`
printf "IP Address: %15s- " "$ipa"
lanadmin -x $i 2>/dev/null | awk '{$1="";printf("%s",$0)}'
echo ""
done






Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.