Google Search

Google

What is the most suitable distro to use as a server?

Visit Us!

Google Groups
Kuantan Linux User Group
Visit this group

Threat Resource Center | Trend Micro

Monday, July 19, 2010

How to clear pending/stuck print job in AIX

## In this scenario the print queue name/printer name is AV169. This is for SAP printing. Check whether the print queue name/printer name is exist or not and it is pingable or not. If everything is fine, then proceed with the 3 steps below


1) root@sap03_R3P / # disable AV169
** This command will disable the printer for a while


2) root@sap03_R3P / # qcan -x 23 -P AV169
** Look for the first print queue ID that is listed. In this case the first print queue ID is 23

root@pxipvsap03_R3P / # lpstat -oAV169
Queue Dev Status Job Files User PP % Blks Cp Rnk
------- ----- --------- --- ------------------ ---------- ---- -- ----- --- ---
AV169 hp@AV RUNNING 23 000IJXSj.R3P r3padm 0 100 16 1 1
QUEUED 191 000J5NyL.R3P r3padm 107 1 2
QUEUED 332 000JUXwn.R3P r3padm 21 1 3

** Enter the command above to remove that print queue. After that, enter command : lpstat -oAV169 | more . If that print queue is still exist repeat the above command until that print queue is remove and disappear from the list. Then, enter again command lpstat -oAV169 | more for confirmation.


3) root@sap03_R3P / # enable AV169
** To enable again the printer, type the above command.


Follow the below steps for how to :)

$ /usr/sbin/ping AV169
PING AV169.domain1.local: (10.xx.xx.xxx): 56 data bytes
64 bytes from 10.xx.xx.xxx: icmp_seq=0 ttl=58 time=2 ms
64 bytes from 10.xx.xx.xxx: icmp_seq=1 ttl=58 time=2 ms
64 bytes from 10.xx.xx.xxx: icmp_seq=2 ttl=58 time=2 ms

----AV169.domain1.local PING Statistics----
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 2/2/2 ms

$ nslookup AV169
Server: pxdces01.domain1.local
Address: 10.xx.xx.xxx

Name: AV169.domain1.local
Address: 10.xx.xx.xxx

$ grep -i AV169 /etc/qconfig
AV169:
device = hp@AV169
hp@AV169:
file = /var/spool/lpd/pio/@local/dev/hp@AV169#hpJetDirect#9100
backend = /usr/lib/lpd/pio/etc/piojetd AV169 9100

$ lpstat -oAV169
Queue Dev Status Job Files User PP % Blks Cp Rnk
------- ----- --------- --- ------------------ ---------- ---- -- ----- --- ---
AV169 hp@AV RUNNING 23 000IJXSj.R3P r3padm 0 100 16 1 1
QUEUED 191 000J5NyL.R3P r3padm 107 1 2
QUEUED 332 000JUXwn.R3P r3padm 21 1 3
QUEUED 341 000JbHe5.R3P r3padm 11 1 4
QUEUED 439 000Lo5Td.R3P r3padm 14 1 5
QUEUED 444 000LuxhR.R3P r3padm 9 1 6
QUEUED 451 000M1QLh.R3P r3padm 11 1 7
QUEUED 619 000O4KQ5.R3P r3padm 45 1 8
QUEUED 623 000O5QcD.R3P r3padm 52 1 9
QUEUED 626 000O6FlJ.R3P r3padm 227 1 10
QUEUED 936 000P5qiX.R3P r3padm 15 1 11
QUEUED 17 000PNitd.R3P r3padm 9 1 12
QUEUED 139 000PPvHt.R3P r3padm 358 1 13
QUEUED 203 000PttcP.R3P r3padm 11 1 14
QUEUED 205 000PurI1.R3P r3padm 40 1 15
QUEUED 206 000PuilV.R3P r3padm 146 1 16
QUEUED 596 000QwNaT.R3P r3padm 81 1 17
QUEUED 74 000S8lJh.R3P r3padm 70 1 18
QUEUED 76 000S92Mj.R3P r3padm 12 2 19
QUEUED 77 000S9AtF.R3P r3padm 27 3 20
QUEUED 80 000S9izJ.R3P r3padm 39 2 21
QUEUED 106 000SCCQb.R3P r3padm 39 2 22
QUEUED 198 000SPfpB.R3P r3padm 40 2 23
QUEUED 366 000Snb4z.R3P r3padm 108 1 24
QUEUED 371 000SoYkb.R3P r3padm 90 1 25
QUEUED 590 000TLYcT.R3P r3padm 14 1 26
QUEUED 598 000TMeob.R3P r3padm 38 1 27
QUEUED 698 000TbEPJ.R3P r3padm 8 1 28
QUEUED 731 000TfuEr.R3P r3padm 8 1 29
QUEUED 767 000Tkzdx.R3P r3padm 8 1 30
QUEUED 11 000UMWor.R3P r3padm 17 1 31
QUEUED 68 000UV3Kr.R3P r3padm 17 1 32
QUEUED 813 000WGUnh.R3P r3padm 11 1 33
QUEUED 815 000WGuNF.R3P r3padm 11 1 34
QUEUED 827 000WIhBx.R3P r3padm 342 1 35
QUEUED 862 000WNe4X.R3P r3padm 276 1 36
QUEUED 907 000WU6in.R3P r3padm 16 1 37
QUEUED 171 000X7yoT.R3P r3padm 14 1 38
QUEUED 288 000XPiT3.R3P r3padm 14 1 39
QUEUED 359 000XbGWP.R3P r3padm 14 1 40

$ lpstat -pAV169 | wc -l
42

root@sap03_R3P / # disable AV169

root@sap03_R3P / # qcan -x 23 -P AV169

root@sap03_R3P / # lpstat -oAV169 | more
Queue Dev Status Job Files User PP % Blks Cp Rnk
------- ----- --------- --- ------------------ ---------- ---- -- ----- --- ---
AV169 hp@AV DOWN
QUEUED 23 000IJXSj.R3P r3padm 16 1 1
QUEUED 191 000J5NyL.R3P r3padm 107 1 2

root@sap03_R3P / # qcan -x 23 -P AV169

root@sap03_R3P / # lpstat -oAV169 | more
Queue Dev Status Job Files User PP % Blks Cp Rnk
------- ----- --------- --- ------------------ ---------- ---- -- ----- --- ---
AV169 hp@AV DOWN
QUEUED 191 000J5NyL.R3P r3padm 107 1 1
QUEUED 332 000JUXwn.R3P r3padm 21 1 2

root@sap03_R3P / # enable AV169

root@sap03_R3P / # lpstat -pAV169 | wc -l
41
root@sap03_R3P / # lpstat -pAV169 | wc -l
38
root@sap03_R3P / # lpstat -pAV169 | wc -l
36
root@sap03_R3P / # lpstat -pAV169 | wc -l
34
root@sap03_R3P / # lpstat -pAV169 | wc -l
32
root@sap03_R3P / # lpstat -pAV169 | wc -l
30
root@sap03_R3P / # lpstat -pAV169 | wc -l
25

Monday, June 7, 2010

MSC Malaysia Open Source Conference 2010

MSC Malaysia Open Source Conference

INVITATION TO PARTICIPATE IN MSC MALAYSIA OPEN SOURCE CONFERENCE 2010

Date: 29 June - 1 July, 2010
Venue: Berjaya Times Square

Come join us at the MSC Malaysia Open Source Conference 2010! You'll be pleasantly surprised...

Who should attend?

  • Business executives from local and foreign companies
  • Open Source developers, communities, inventors, evangelist, researchers, strategist
  • Government officers
  • Students, general public

Why you should attend?

  1. Provide exposure and knowledge on the importance of Open Source in enhancing competitiveness by giving freedom of choice in software usage with lower total cost of ownership, hence benefiting businesses and society at large. Over 30 session tracks are made available.
  2. Share amongst the open source community on new directions and latest innovations by the subject matter experts, thought leaders and industry gurus.
  3. Provide a platform for conference participants to actively interact, share and exchange views, ideas, and tools on the latest trends and issues of Open Source.
  4. Networking, learning and having great fun!

Click here for more details!

Saturday, May 1, 2010

HP-UX : Managing Disc Basic

To check available disk space and file system, type bdf

[hpa50-12]/ >bdf
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol3 204800 70848 132960 35% /
/dev/vg00/lvol1 295024 26616 238904 10% /stand
/dev/vg00/lvol8 1560576 273496 1277096 18% /var
/dev/vg00/lvol7 909312 858128 50848 94% /usr
/dev/vg00/lvol4 204800 2800 200496 1% /tmp
/dev/vg00/lvol6 929792 695864 232144 75% /opt
/dev/vg00/lvol5 20480 2320 18024 11% /home

** The bdf command displays the amount of free disk space available


To check physical volume of disk, type ioscan -funC disk

[hpa50-12]/ >ioscan -funC disk
Class I H/W Path Driver S/W State H/W Type Description
======================================================================
disk 0 0/0/1/1.15.0 sdisk CLAIMED DEVICE HP

18.2GST318406LC
/dev/dsk/c1t15d0 /dev/rdsk/c1t15d0
disk 1 0/0/2/1.15.0 sdisk CLAIMED DEVICE HP

18.2GMAN3184MC
/dev/dsk/c3t15d0 /dev/rdsk/c3t15d0

** Ioscan scans system hardware, usable I/O system devices, or kernel I/O system data structures as appropriate, and lists the results.



To check further information of physical volume type, pvdisplay /Physical/volumes/path

[hpa50-12]/ >pvdisplay /dev/dsk/c1t15d0
--- Physical volumes ---
PV Name /dev/dsk/c1t15d0
VG Name /dev/vg00
PV Status available
Allocatable yes
VGDA 2
Cur LV 8
PE Size (Mbytes) 4
Total PE 4340
Free PE 3074
Allocated PE 1266
Stale PE 0
IO Timeout (Seconds) default
Autoswitch On

** pvdisplay - display information about physical volumes within LVM volume group


To check Volume Group (VG), look at the output of the bdf command and see at the Filesystem field, /dev/vg00 <-- vg00 is the Volume Group (VG). Then type command, vgdisplay

volumegr0up [hpa50-12]/ >vgdisplay vg00
--- Volume groups ---
VG Name /dev/vg00
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 8
Open LV 8
Max PV 16
Cur PV 1
Act PV 1
Max PE per PV 4350
VGDA 2
PE Size (Mbytes) 4
Total PE 4340
Alloc PE 1266
Free PE 3074
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0


To scan the existing volume group, type vgscan

[hpa50-12]/ >vgscan
vgscan: The physical volume "/dev/dsk/c1t15d0" is already recorded in the

"/etc/lvmtab" file.
Physical Volume "/dev/dsk/c3t15d0" contains no LVM information

** vgdisplay - display information about LVM volume groups



To check Logical Volume, look at the output of the bdf command and see at the Filesystem field, /dev/vg00/lvol3, /dev/vg00/lvol1 and /dev/vg00/lvol8. lvol3, lvol1 and lvol8 are the logical volume. To getthe information of logical volume type, lvdisplay /dev/vg00/logicalVolume


=========
Example1
=========

[hpa50-12]/ >lvdisplay /dev/vg00/lvol3
--- Logical volumes ---
LV Name /dev/vg00/lvol3
VG Name /dev/vg00
LV Permission read/write
LV Status available/syncd
Mirror copies 0
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 200
Current LE 50
Allocated PE 50
Stripes 0
Stripe Size (Kbytes) 0
Bad block off
Allocation strict/contiguous
IO Timeout (Seconds) default


=========
Example2
=========

[hpa50-12]/ >lvdisplay /dev/vg00/lvol1
--- Logical volumes ---
LV Name /dev/vg00/lvol1
VG Name /dev/vg00
LV Permission read/write
LV Status available/syncd
Mirror copies 0
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 300
Current LE 75
Allocated PE 75
Stripes 0
Stripe Size (Kbytes) 0
Bad block off
Allocation strict/contiguous
IO Timeout (Seconds) default


=========
Example3
=========

[hpa50-12]/ >lvdisplay /dev/vg00/lvol8
--- Logical volumes ---
LV Name /dev/vg00/lvol8
VG Name /dev/vg00
LV Permission read/write
LV Status available/syncd
Mirror copies 0
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 1524
Current LE 381
Allocated PE 381
Stripes 0
Stripe Size (Kbytes) 0
Bad block on
Allocation strict
IO Timeout (Seconds) default


[hpa50-12]/ >ioscan -kfC ext_bus
Class I H/W Path Driver S/W State H/W Type Description
=================================================================
ext_bus 0 0/0/1/0 c720 CLAIMED INTERFACE SCSI C896 Ultra Wide

LVD
ext_bus 1 0/0/1/1 c720 CLAIMED INTERFACE SCSI C896 Ultra Wide

Single-Ended
ext_bus 2 0/0/2/0 c720 CLAIMED INTERFACE SCSI C87x Fast Wide

Single-Ended
ext_bus 3 0/0/2/1 c720 CLAIMED INTERFACE SCSI C87x Ultra Wide

Single-Ended



To get information of what disk and filesystem that currently mount type, mount

[hpa50-12]/ >mount
/ on /dev/vg00/lvol3 log on Fri Apr 30 17:28:38 2010
/stand on /dev/vg00/lvol1 defaults on Fri Apr 30 17:28:38 2010
/var on /dev/vg00/lvol8 delaylog,nodatainlog on Fri Apr 30 17:28:42 2010
/usr on /dev/vg00/lvol7 delaylog,nodatainlog on Fri Apr 30 17:28:42 2010
/tmp on /dev/vg00/lvol4 delaylog,nodatainlog on Fri Apr 30 17:28:42 2010
/opt on /dev/vg00/lvol6 delaylog,nodatainlog on Fri Apr 30 17:28:42 2010
/home on /dev/vg00/lvol5 delaylog,nodatainlog on Fri Apr 30 17:28:43 2010

[hpa50-12]/ >bdf
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol3 204800 70848 132960 35% /
/dev/vg00/lvol1 295024 26616 238904 10% /stand
/dev/vg00/lvol8 1560576 273496 1277096 18% /var
/dev/vg00/lvol7 909312 858128 50848 94% /usr
/dev/vg00/lvol4 204800 2800 200496 1% /tmp
/dev/vg00/lvol6 929792 695864 232144 75% /opt
/dev/vg00/lvol5 20480 2320 18024 11% /home

Sunday, April 18, 2010

Use Variables with Scripts

Using an editor or the cat command, write a script that uses a variable. Note that this script uses the bash shell on LINUX, but you can also use the ksh shell with UNIX.


1) Set a value for the variable first using typeset then check it using set.

[root@vmpc_rh804 root]# typeset first=you
[root@vmpc_rh804 root]# set | more
BASH=/bin/bash
BASH_ENV=/root/.bashrc
BASH_VERSINFO=([0]="2" [1]="05b" [2]="0" [3]="1" [4]="release" [5]="i686-pc-linu
x-gnu")
BASH_VERSION='2.05b.0(1)-release'
COLORS=/etc/DIR_COLORS
.
.
.
first=you
hi=hello
langfile=/root/.i18n


2) Write a short Welcome script that uses a variable.

[root@vmpc_rh804 root]# cat > Welcome.bash
#!/bin/bash
#
first=Student
echo "Welcome to Linux $first"
Ctrl/D


3) Execute your script using the shell interpreter.

$ bash Welcome.bash
Welcome to Linux Student

Invoke a Script

Use various methods to invoke a script, and determine when it runs in your shell, and when a subshell is created.


1) Using an editor or the cat command, write a korn or bash script that:
* Executes the ps command.
* Echos the value of the shell variable hi.

[root@vmpc_rh804 root]# cat > do-ps.bash
#!/bin/bash
# This script displays active processes
#
ps
echo $hi


2) Set the value of hi to hello in your current command line shell.

[root@vmpc_rh804 root]# hi=hello


3) Execute your script using the shell interpreter.

[root@vmpc_rh804 root]# bash do-ps.bash
PID TTY TIME CMD
1311 pts/4 00:00:00 bash
1358 pts/4 00:00:00 bash
1365 pts/4 00:00:00 ps

** Note that it doesn't recognize the hi variable. This is because the variable is local to the shell in which it was defined. When this script is executed, a new shell is started that is outside your local shell. **


4) Add execute privilege to the script file and run it as a command from the current directory.

[root@vmpc_rh804 root]# chmod +x do-ps.bash
[root@vmpc_rh804 root]# ./do-ps.bash
PID TTY TIME CMD
1311 pts/4 00:00:00 bash
1367 pts/4 00:00:00 do-ps.bash
1374 pts/4 00:00:00 ps


5) Use the built-in source command to execute the commands in the script file.

[root@vmpc_rh804 root]# source do-ps.bash
PID TTY TIME CMD
1311 pts/4 00:00:00 bash
1375 pts/4 00:00:00 ps
hello
[root@vmpc_rh804 root]#


** Note that it is able to recognize the hi variable. This is because the source command runs this script in the local shell. **

Linux News Of The Day!

Powered By
widgetmate.com
Sponsored By
Credit Card Forum

Open Source Newsreel

Loading...