Bulk modify all iPrint printer gateway load strings

  • 7005459
  • 26-Apr-2012
  • 01-May-2012


Novell iPrint for Linux


The administrator desires to modify all printer agent gateway load strings.  However, the obvious tools to accomplish that (iManager and PsmStatus page) require each printer agent to be individually changed. When many printer agents need to be modified, this can be time consuming.  Is there a way to change all the printer agent gateway autoload commands at once?

A common (and recommended) change to the printer agent gateway load command is to change the port from LPR to RAW.  RAW is more efficient, requires less configuration, and less error prone.  Follow these steps to change all printer agents to the RAW configuration.


This can be accomplished by running a sed command against the Print Manager XML file, then importing the changes made to the XML file. See the steps below.

Note 1: If some printer agents are already configured for a RAW connection, the follow steps will change only those printer agents with the LPR configuration.

Note 2: Special gateway parameters (such as NOSNMP, NULL, SPOLL, GETCOMMUNITYSTRING, WAITONPRINTER, etc) will be removed from the gateway autload command by implementing these steps.

Step 1: Copy the Print Manager XML file to the tmp directory:
cp /var/opt/novell/iprint/<directory-holding-current-Print-Manager-database>.psm/padbtxt.xml /tmp/importRAWconfig.xml
Note: Replace <directory-holding-current-Print-Manager-database> with the name and context of the Print Manager.
Step 2: Change all of the gateway load commands:
Use the following sed command to modify the copied xml file (importRAWconfig.xml) to have all the printer agent gateway load commands change from whatever configuration they have, to the RAW connection configuration.  Note:  This is one long command.
sed -i s:PRINTERNAME[A-Za-z0-9\ =]*::g importRAWconfig.xml;sed -i s:PORT=LPR:PORT=RAW:g importRAWconfig.xml;sed -i s:\ \<:\<:g importRAWconfig.xml
Step 3: Verify the ouput file (importRAWconfig.xml) looks correct:
grep -i gatewayloadstring /tmp/importRAWconfig.xml
This command will output all lines with the gateway load string to the screen so you can easily see how each gateway load line is configured.  Each line should look something like this:
<gatewayloadstring>iprintgw PORT=RAW HOSTADDRESS=</gatewayloadstring>
Step 4: Import the change configuration to the Print Manager database:
This step differs between OES2 and OES11:
iprintman psm --xml-import /tmp/importRAWconfg.xml -u admin
Note: you will be prompted for the eDir admin password.
After the XML items are processed, restart the Print Manager for the change to take effect.
rcnovell-ipsmd restart
rcnovell-ipsmd stop
/opt/novell/iprint/bin/ipsmd -x /tmp/importRAWconfig.xml -u cn=admin,o=<OrgName>
Note 1: Replace cn=admin,o=<OrgName> with the LDAP distinguished name of the eDir administrator
Note 2: you will be prompted for the eDir admin password.