Step 1: Choose a server where you can access all your LPAR’s
Step 2: Generate a key from the chosen server and then scp same key to LPAR under /root
Step 3: Now, You can execute the below script from chosen server

Note:- In our case, We have chosen NIM server as our source server where the script to be executed
server_printer – Should contain LPAR or server name
Name of the script: print_status.sh

echo Server Name,Printer Name,IP Address,Status

for printer_list in `cat server_printer`
do
for printer_name in `ssh $printer_list lsallq`
do
prtip=`ssh $printer_list cat /etc/hosts |grep "$printer_name" |awk '{print $1}'`
stat=`ssh $printer_list lpstat -p"$printer_name" |grep -ivE "Queue|--|Active" |grep -v "No entries" |awk '{print $3}'`
echo $printer_list,$printer_name,$prtip,$stat
done
done
Advertisements