Updating iManager plugins for NCS, BCC, NSS, and ARK
I frequently update my iManger plugins for NCS1 and BCC. In doing so, I have found that iManager does not always updating the plugins properly. The problem is that when you delete the plugin iManager does not always delete the corresponding files on the disk. With BCC, we realized this and added a section to the BCC 1.1. readme. This new section outlines the process necessary to update your iManager plugins. Part of this process is to manually delete the iManager plugin files on the iManager server.
I don't like doing things manually. It takes too much time when you have to do it over and over again, and there is always room for error. I can't tell you how many times I forgot to delete a particular file or directory. I've heard the same complaint from some of my colleagues and a few customers too, so I decided it was time to do something about it.
With that short introduction, let me introduce you to a small Perl script I wrote. This Perl script exists to automate the cleanup of the iManager plugin files and directories. It works with the ARK, BCC, NCS, and NSS plugins. It can handle iManager servers on both Linux and NetWare, although adding support for a Windows iManager server would be trivial (see the GetPrefix() function). Finally, it supports iManager 2.5 and iManager 2.6. Likewise, adding support for iManager 2.7 would be trivial as well.
To run the script on Linux, do the following. This script must be ran on the iManager server. As such, all of the steps below are to be done on the iManager server.
- You must be the root user when you run this script.
- Ensure that Perl is installed on the server.
- Copy the script to ~/bin
- Change to the ~/bin directory
- Set the permissions on the script via the shell command "chmod 0770 imgr_clean.pl"
- Execute the script via the shell command "./imgr_clean.pl [options]" You can optionally execute the command via the shell command "perl -w ~/bin/imgr_clean.pl [options]" See the usage section below for more details on the script options.
To run the script on NetWare, do the following. This script must be ran on the iManager server. As such, all of the steps below are to be done on the iManager server.
Ensure that Perl is installed on the server.
Copy the script to sys:\perl\scripts.
Execute the script via the console command "perl -w imgr_clean.pl [options]" See the usage section below for more details on the script options.
The following details how to use the script. This is a copy of the actual help text the utility provides.
imgr_clean.pl 0.1. Copyright (c) 2007 Novell, Inc. All Rights Reserved.
Usage: perl -w imgr_clean.pl [OPTION]
Removes the Novell iManager plugin files for NCS/BCC, NSS, and ARK
Valid options are:
--ark Removes the files for the ARK plugin
--common Removes the files for the common storage plugin
--ncs Removes the files for the NCS/BCC plugin
--nss Removes the files for the NSS plugin
--verbose Prints information as each file and directory are removed
--help Display this help and exit
At least one of --ark, --common, --ncs, or --nss must be specified
Now for a few examples. Lets assume I want to remove the plugins for NCS/BCC, NSS, and the common storage code. On a console screen on the iManager server I would execute the following command.
perl -w imgr_clean.pl ?ncs ?nss ?common
Likewise, if I only wanted to remove the NCS/BCC plugin I would execute the following command.
perl -w imgr_clean.pl ?ncs
Finally, if I wanted to remove the NCS/BCC plugin and gets lots of feedback on what the script is doing I would execute the following command.
perl -w imgr_clean.pl ?ncs ?verbose
That's all there is to it. The script takes just a few seconds to run and saves you the time of having to remove all of these files and directories manually. Furthermore, it removes the correct files and directories each and every time.
1 The following is a list of acronyms used in this document. I know I'm supposed to define acronyms up front, but what can I say.
Disclaimer: As with everything else at Cool Solutions, this content is definitely not supported by Novell (so don't even think of calling Support if you try something and it blows up).
It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.