- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Scripting printer additions on HP-UX B.11.31
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2011 07:50 AM
10-06-2011 07:50 AM
Scripting printer additions on HP-UX B.11.31
Hello all!
I have a lot of printer queues to bring from one old HP-UX server to a new one and don't really want to use 'hppi' for each one...I found an old script for doing these additions in lp (http://www.knowledgeroot.com/hp-ux/printer/create-printer-on-hp-ux-using-script/), and it does add a queue in /etc/lp/members, but the printer queue is not then showing in hppi. It shows up fine (accepting connections) with "lpstat -a".
Is there a better way to handle this so that I can script additions but they are available in hppi?
Thanks!
- Tags:
- migration
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2011 05:44 AM
10-10-2011 05:44 AM
Re: Scripting printer additions on HP-UX B.11.31
have you tried SAM utilities?
SAM - Printers and Plotters - LP Spooler - Save/Restore Spooler Config (this works at least in 11.11)
HTH
V.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2011 10:45 AM
10-10-2011 10:45 AM
Re: Scripting printer additions on HP-UX B.11.31
I have about 250 queues, we've migrated OS's a couple of times. I scripted on 11.11 using the addqueue command.
I would run things through a do while or "for do script.
export SDE=`date +%m/%m/%Y`
echo $SDE
export STI=`date +%T`
echo $STI
echo "Enter IP Address of Printer:\n"
read IP
sed s/IPADDRESS/$IP/g TEMPLATE >TEMPLATE2
echo $QN
read
sed s/QUENAME/$QN/g TEMPLATE2 >TEMPLATE3
chmod 775 TEMPLATE3
./TEMPLATE3
chmod 600 TEMPLATE3
# more TEMPLATE
addqueue -i PTYPE -h IPADDRESS -q QUENAME -b off
lp -dQUENAME /tmp/test
If your printers are HP brand printers with SNMP enabled generally this works fairly well.
You would have to modify the script to fit your need, I use mine in a one by one thing now.
you would need a delimited file, Containing "PRINTERTYPE" "IPADDRESS" and "QUENAME"
the snag is generally the printer type.
We have some of the newer MFP's that are Toshiba or Ricoh and have to use hppi -s and because they do not comply with the HP/Canon engine, they are not recognized on HP
on HP there is a port for CUPS.this allows for a broader range of printers..
For we worked on a migrations to CUPS from HP and came up with a semi-workable solution.
this script would build a cups file based on your current HP queues:
#!/bin/sh
echo $qname $ipaddr
for qname in `ls /var/spool/lp/interface/*`
do
export ipaddr=`grep PERIPH= "$qname" |grep -v MODEL | awk -F'=' '{print $2}'`
echo $qname $ipaddr
outfile=$1
if [ -z "$outfile" ]
then
echo "USAGE: hp2cups <output file>"
exit 1
else
> $outfile
fi
/usr/sam/lbin/lpmgr | while read printnfo
do
isremote=`echo $printnfo \
| cut -d":" -f3 \
| cut -d"," -f1`
if [ "$isremote" = "yes" ]
then
name=`echo $printnfo | cut -d":" -f1`
remote=`echo $printnfo \
| cut -d":" -f5 \
| awk '{print $3}'`
cat >> $outfile << EOF
<Printer $qname>
Info Created by $USER
DeviceURI socket://"$ipaddr":9100
Location
State Idle
Accepting Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
</Printer>
EOF
fi
done
#########################################
done
- Tags:
- cups