iPrint Linux XML Generator Script for moving printers from NetWare to OES Linux

iPrint Linux XML Generator Script for moving printers from NetWare to OES Linux

This iPrint Linux XMLGenerator script manipulates a NetWare generated XML file to be compatible with the Linux XML import feature. After the script has manipulated the NetWare XML, the newly created Linux compatible XML can be used with the xml-import feature to auto-create the NetWare printer agents to the Linux Print Manager. Printer agents will exist on the original NetWare Print Manager and the Linux Print Manager. iPrint printers installed to workstations will continue to print to the NetWare Print Manager until the administrator changes DNS assignments or redirects the NetWare printer agents to the Linux printer agents.

Platforms Supported:



OES1 and OES2 (32 and 64 bit)

Features Not Implimented Yet:




  1. Automatic printer driver associations are not attempted with this script. You must manually associate printer drivers to the Linux printer agents using iManager after the script and xml-import command have been executed.



Related Scipts:


The iprint-driver-copy script can be used in conjunction with this script to auto copy the NetWare Broker printer drivers to the Linux Driver Store. After the iprint-driver copy script is executed, the administrator can manually associate printer drivers to printer agents using iManager.

The iprint-driver-copy script can be found here:
http://www.novell.com/communities/node/6167/iprint-driver-copy-script-migrating-iprint-netware-drivers-oes-linux

Usage Instructions:





  1. Download the PSMInfo.zip file.


  2. Unzip the file and copy the PSMInfo.nlm to the Print Manager server's sys:\ndps\ directory on the Netware server.


  3. Load the PSMInfo.nlm.
    #Load PSMInfo.nlm


  4. Copy the auto-generated sys:\ndps\PSMINFO.XML on the Netware server to the Linux server's tmp directoy.


  5. Download the iprint-linux-XMLGenerator-1.1.tgz file to /tmp directory.


  6. Open a Terminal window and type “su”.


  7. Enter root’s password.


  8. Extract the script from the tarball.

    #tar –xzvf iprint-linux-XMLGenerator-1.1.tgz


  9. Make the script executable.

    #chmod 755 iprint-linux-XMLGenerator-1.1.sh


  10. Run the script to make a new XML file compatible for iprintman. The file will be called import.xml


    #./iprint-linux-XMLGenerator-1.1.sh -f [/directory/PSMINFO.XML] -t [Tree_Name] -m CN=[manager_Name],OU=[Container],O=[Organization] -s [hostname.domain.com] -d [eDirServer.domain.com] -i CN=[Driver_Store_Name],OU=[Container],O=[Organization] -c OU=[Container],O=[Organization]

    Example:./iprint-linux-XMLGenerator-1.1.sh -t JoeUser-tree -m cn=printmanager,ou=print,o=novell -s joeserver.novell.com -i cn=driverstore,ou=print,o=novell -f /tmp/PSMINFO.XML -c ou=print,o=novell


  11. Run iprintman to import the newly created XML file to populate the Print Manager.

    #iprntman psm --xml-import ./import.xml




    Explanation of the switches used:



MANDATORY ARGUMENTS:

Note: The arguments will be executed in the order listed on the commandline.


-t Used to specify the tree name.

-m Used to specify the fully distinguished for the Manager.

-s Used to specify the DNS name or IP address for the server hosting the manager.

-i Used to specify the fully distinguished for the Driver Store.


OPTIONAL ARGUMENTS

-f Used to specify the file path to the XML file.

-c Used to specify the context of where to place the print objects.

-d Used to specify the DS server's DNS name or IP address

-h This switch will display the help menu.

Labels (2)
Attachments

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Comments
Can not get the script to work.
Getting the error: The file does not exist in this location ./. Please choose another filename or location.
Getting error: sed: can't read -: No such file or directory
grep: : No such file or directory
expr: non-numeric argument
This is manLineDelta:
expr: syntax error
sed: -e expression #1, char 3: unexprected `,'
Here is the command: ./iprint-linux-XMLGenerator-1.1.sh -t [TREE] -m cn-server_manager,o=ha -s [server] -i cn=server_driverstore,o= -f ./
No matter where I move the file or run the script I get that error.
Make sure you are using the syntax that is found in comment #10.
I have tried several times. Can not get past step 10. I have used the syntax above, both documentation and the example. Also tried the help '-h' example. No luck. In all three examples, none were consistent in documentation. In the help menu it says to use -h, when I think it should be -s.

Regardless of what I try it's always the same error. Here is what I am typing:

./iprint-linux-XMLGenerator-1.1.sh -f/tmp/PSMINFO.XML -t HEWITT_LINNFT10 -m cn=LINNFT13_Manager,o=ha -s linnft13.hewitt.com -i cn=LINNFT13_DrvStr,o=ha -c ou=PrintOES,o=ha

ERROR:
Invalid parameter specified. Please run the command again with a -h for more help.

sed: can't read -: No such file or directory
grep: : No such file or directory
expr: non-numeric argument
This is manLineDelta:
expr: syntax error
sed: -e expression #1, char 3: unexpected `,'

I have both the source file and script files listed properly:
*************************
SOURCE FILE
linnft13:/tmp # dir PSMINFO*
-rw-r--r-- 1 root root 22622 Jan 9 10:19 PSMINFO.XML
linnft13:/tmp #
*************************
SCRIPT FILE
linnft13:/Patches/iPrint/XMLgenerator # ls -l
total 16
-rwxr-xr-x 1 admin root 10207 Nov 21 12:29 iprint-linux-XMLGenerator-1.1.sh
-rwxr-xr-x 1 root root 3262 Jan 9 10:16 iprint-linux-XMLGenerator-1.1.tgz
linnft13:/Patches/iPrint/XMLgenerator #

Am logged in as root, the file has read access.

I have recreated the psminfo.xml file incase it was currupted.

It seems that this is just updating the psminfo.xml file and converting it to the import.xml file. Can you send me a converted import.xml file and I can do a search and replace on my own. I particularly don't know what to modify for the driver store as there is nothing in my psminfo.xml file regarding Broker or Driver Store. I hope to get this working as we will be converting over 100 iPrint servers from Neware to OES2.

I have used the Driver Store script with no issues. Thanks for that.

Thanks.


Have you guys gotten this script to work? I am getting the same errors as you guys. I took the same troubleshooting steps, but cannot get it to run. This would be very helpful as I am also involved in a netware to OES2 iprint migration. I'd appreciate any advice. Thanks!!
I also had the same problems with the iprint-linux-XMLGenerator-1.1.sh as per the previous comments. Here's how I fixed it

Edit the iprint-linux-XMLGenerator-1.1.sh in your favorite editor and look for this section

execCalls ( )
{

if [ -n "$treeName" ] && [ -n "$managerName" ] && [ -n "$hostName" ] && [ -n "$idsName" ]; then

#removedrivers $1
driverMatch

Now remove the comment from the line

#removedrivers $1

and add a comment to the line

drivermatch

so it looks like this

execCalls ( )
{

if [ -n "$treeName" ] && [ -n "$managerName" ] && [ -n "$hostName" ] && [ -n "$idsName" ]; then

removedrivers $1
#driverMatch

Save the file.

That should do it. I now get an import.xml file created, when I run the script.
Top Contributors
Version history
Revision #:
9 of 9
Last update:
‎2020-01-21 21:42
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.