NetBackup 101 (for me)

ok, just hang with me while I learn NB.
some jobs were stalled in a machine, so we went to the media server and checked if the jobs were pending
and the tape drives were not in “TSD”:
bash-3.00# /usr/openv/volmgr/bin/vmoprcmd
PENDING REQUESTS
<NONE>
DRIVE STATUS
Drv Type Control User Label RVSN EVSN Ready Wr.Enbl. ReqId
0 dlt TSD – No – –
1 dlt TSD root Yes EBI219 EBI219 Yes Yes 1
ADDITIONAL DRIVE STATUS
Drv DriveName Multihost Assigned Comment
0 QUANTUMDLT70000 No –
1 QUANTUMDLT70001 No ebitdb1
In the “pending” section there were jobs pending on drv 1 and 0, and the tape drives were unavailable, so we
reset them:
# vmoprcmd -deny 0
# vmoprcmd -deny 1
# vmoprcmd -up 0
# vmoprcmd -up 1
We assumed the drives were recently fed with tapes, so after this jobs were running ok.
To see the active jobs…
#bpdbjobs -report |grep -i act
To see the queued jobs…
#bpdbjobs -report | grep -i que
To kill a job
#bpdbjobs -kill <job#>
To see the job summary…
#/usr/openv/netbackup/bin/bpdbjobs -summary
#bpps -a
To run an inventory on a tape library…
#bpinvent 0
259/433
Check last 24 hour’s errors
#bperror -U -backstat -hoursago 24
See available tapes
# available_media
Or go to bpadm – media mgmt – special actions – Inventory a Robot and Compare with Volume Configuration
To see if a tape is in the correct pool
#vmquery -m <mediaid>
To change a tape of pool
# vmchange -h ntxldb2 -p 1 -m NTXD53
(Where 1 is NetBackup and 2 is systems)
To see the pools
#vmpool -listall
A monitoring loop:
# while true;do clear; vmoprcmd; echo “active”; bpdbjobs -report |grep -i act;echo “queued”; bpdbjobs -report
|grep -i que;bpdbjobs -summary; bperror -U -backstat -hoursago 24| tail -15l; sleep 5; clear; done
Run bpadm for interactive actions
# bpadm
document
too
260/433

readonly /etc/fstab

If you’re trying to save your /etc/fstab and you get:
“fstab” E212: Can’t open file for writing
And you know you can write any other file in “/”, then it’s not a readonly FS.
You need to check the file’s attributes.
[root@myserver etc]# lsattr /etc/fstab
—-i——– /etc/fstab
if it has a “i” then it’s write protected, so change it
[root@myserver etc]# chattr -i /etc/fstab
[root@myserver etc]# lsattr /etc/fstab
————- /etc/fstab
Then you can edit the file
75/433

gawk construct to build a line from each 3 lines

We got the output from “sar -ruq” in a file, we stored in sar2.txt, and it looks like this:

11:44:51 633773 22954346
4 1 3 93
0.0 0 0.0 0
11:44:56 633773 22954288
2 2 1 94
0.0 0 0.0 0
11:45:01 632206 22786120
13 18 13 56
9.0 20 0.0 0
11:45:06 625509 22462685
53 47 0 0
5.0 99 0.0 0

So we want to plot it in excel, we need one line per sample, much like this:

11:45:06 625509 22462685 53 47 0 0 5.0 99 0.0 0
11:45:11 628749 22770298 59 41 0 0 4.8 100 0.0 0
11:45:16 630432 22733837 55 45 0 0 6.8 100 0.0 0

So we wrote a small gawk expression to do it:

gawk 'ORS=NR%3?" ":"n"' sar2.txt

So simple, we’re using the modulus function here to do the job. Coming to a blog near you!

check network speed in suse

I wrote a script that shows you in a condensed way if you’re in network card speed trouble:
# ——————— server app213
bond0= eth1 eth2
bond0 : : : : : 10.20.9.38
eth0 : 100Mb/s : Half : on : yes : 192.168.5.119
eth1 : 100Mb/s : Half : on : yes :
eth2 : 100Mb/s : Half : on : yes :
eth3 : Unknown! (65535) : Unknown! (255) : on : no :
Here it goes:
#!/bin/bash
DIR=/tmp/.dir
mkdir $DIR > /dev/null 2>&1
HB=`ifconfig -a | grep -i bond | wc -l | sed ‘s/ //g’`
if [ “$HB” -ne “0” ];then
for i in `ifconfig -a | cut -c0-10 | egrep -i ‘bond’| grep -v ‘:’`;do
echo -n “$i=”
for i in `cat /etc/sysconfig/network/ifcfg-$i | grep “BONDING_SLAVE” | awk -F”=” ‘{ print $2 }’ | awk -F”‘” ‘{
print $2 }’`;do
echo -n ” $i”
done
echo “”
done
fi
for i in `ifconfig -a | cut -c0-10 | egrep -i ‘bond|eth’| grep -v ‘:’`;do
SP=`ethtool $i | grep “Speed:” | awk -F: ‘{ print $2 }’`
DU=`ethtool $i | grep “Duplex:” | awk -F: ‘{ print $2 }’`
AU=`ethtool $i |grep “Auto-negotiation:” | awk -F: ‘{ print $2 }’`
LI=`ethtool $i | grep “Link detected: ” | awk -F: ‘{ print $2 }’`
(for w in `ifconfig $i`;do
echo “$w”
done) | grep “addr:” | awk -F”:” ‘{ print $2 }’ > $DIR/addr
echo “$i : $SP : $DU : $AU : $LI : `cat $DIR/addr` ”
done
set network card speed by default in redhat.
If your interface is eth0, in the etc/sysconfig/network-scripts folder, vi the ifcfg-eth0 script. add the parameters
ETHTOOL_OPTS=”speed 100 duplex full autoneg on”, and you’re set
Next time the server reboots you have the right speed set
215/433
216/433

To add static routes

Yeah, we all go and put a script on /etc/rc2.d or /etc/rc3.d
But to be clean on Solaris 8, 9 and 10 you can add your static routes at /etc/gateways like this:
net 100.100.100.0 gateway 192.1.243.1 metric 1

for Solaris 10 11/06, we can use the “-p” parameter

/usr/sbin/route -p add 175.168.0.0 192.168.2.1

these routes are stored in /etc/inet/static_routes
have fun