iMapper Community

InterMapper 5.2 introduces an expanded SDK, including the ability to export many of the files in the InterMapper Settings folder via an HTTP API. We have created two scripts, one for Windows, one for everything else, to make use of the HTTP API to implement cloning of an InterMapper installation.

Users are often reluctant to stop their running InterMapper installations for any number of good reasons. Because this cloning operation can be performed while the InterMapper installation being cloned is still running, it is useful to the user in several scenarios:

1) A ready-to-use alternate in case of primary failure. You can keep a second InterMapper installation ready to start up in the event of failure of the primary installation. By periodically executing the cloning script via a scheduler such as cron or at, you can automatically update this alternate, so that it will be guaranteed to be up-to-date as of your last script execution.

2) An easy way to create a test installation without stopping your primary installation. By using this script, you can, without stopping your primary InterMapper installation, clone an existing installation to use in testing a new release of InterMapper before committing it to production.

3) As a demo of the API. If you think you might be able to make use of an HTTP API, these scripts provide a working example of how to use it.

Several notes:

1) While the InterMapper installation being cloned must be running, the target InterMapper installation must not be, as the cloning script must be able to overwrite files there.

2) The cloning script copies the entire InterMapper Settings folder, except for the Chart Data folder and the InterMapper Logs folder. Thus, it is not an appropriate tool for making a complete backup of your InterMapper installation.

3) The cloning script only copies the InterMapper Settings folder; it does not copy InterMapper itself. You must manually install InterMapper on any alternate machine.

To download the scripts:

Windows version
Mac/Linux/Unix version

More reading:

Complete information about the scripts and their use
HTTP API Overview (There's a lot more to it than I've mentioned here.)

Comment

You need to be a member of iMapper Community to add comments!

Join iMapper Community

Jonathan G Comment by Jonathan G on February 8, 2010 at 3:30pm
oops, I had an error in the "Preferences", all working now - thanks! :)
Christopher L. Sweeney Comment by Christopher L. Sweeney on February 8, 2010 at 3:01pm
The error would seem to indicate that the curl before the mv didn't actually download a Preferences file. If you add -v to the curl statement, does it tell you any more about what happened? Does a Preferences file actually appear to be downloaded at all?
Jonathan G Comment by Jonathan G on February 8, 2010 at 1:42pm
Bingo! - that URL:port worked
well almost, it processed many files then erred out here (code excerpt):
# Preferences file is separate, since it's stored in the top level of the InterMapper_Settings directory
curl $auth -s -O https://$remote:$port/~files/Preferences
mv Preferences ../




Processing certificates...
Pending.csr
SSLCertificateKeyFile
SSLCertificateFile
Processing translations...
mv: cannot stat `Preferences': No such file or directory
Christopher L. Sweeney Comment by Christopher L. Sweeney on February 8, 2010 at 1:25pm
We're expecting you to turn on InterMapper's web server and use the port you've assigned it, not to use port 8182 (which goes to the InterMapper DataCenter if it's installed on the same machine, not to the InterMapper server itself). To turn on the InterMapper server's web server, in the InterMapper GUI go to Edit->Server Settings, click on "Web Server", and click "Start". Before clicking start, choose a different port if the default port (80) is already in use on your machine. You can also specify that it should use a secure protocol if you prefer. The URL that shows in that pane after your changes is the URL you should use.
Jonathan G Comment by Jonathan G on February 8, 2010 at 1:24pm
I changed the "curl" command to "curl -k" to ignore the 'unknown' SSL certificate. Curl now proceeds, but attempts to download an HTML page:

topdirs=$(curl -k $auth https://$remote:$port/~files | tr '\r' '\n')

where my remote: port is https://10.10.99.99:8182

# ./clone_im.sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 2635 0 2635 0 0 29685 0 --:--:-- --:--:-- --:--:-- 2573k
Processing
Jonathan G Comment by Jonathan G on February 8, 2010 at 12:33pm
Christopher
To be certain, I am pointing at the correct web instance, do I use this URL?
https://10.10.99.99:8182/
(the management interface of IM where I login with "admin" and "password")
Note that it is httpS, and the script assumes HTTP.
If not, then what URL do I use in the script?
Christopher L. Sweeney Comment by Christopher L. Sweeney on February 8, 2010 at 12:28pm
IM 5.2 is the first version it will work with. I just ran your problem by the appropriate developer. He says:

At a first guess, there's no password set, which is breaking the curl command
line. curl requires both a username and a password; set the username to "" to
avoid either one.

If that doesn't work, remove the "-s" from the curl invocations to make it print
errors as they happen.
Jonathan G Comment by Jonathan G on February 8, 2010 at 12:27pm
Christopher
I am running Intermapper Version 5.2 (Build A1071)
Has the script been rev'd to the latest version of IM ?
Jonathan
Christopher L. Sweeney Comment by Christopher L. Sweeney on February 8, 2010 at 11:35am
Thanks for the questions, Jonathan. We'll look into the failure you reported and find out what's going on there. As far as your third question goes, the reason for using this script is that it can be (must be, of course) executed while the InterMapper server is running. Using scp on the InterMapper Settings folder for a live InterMapper server is a not a good idea, for two basic reasons: 1) You can't be guaranteed the consistency of a given map file; 2) If scp prevents InterMapper from reopening certain log files and chart files (there are too many for it to keep them all open at the same time), the InterMapper server will stop abruptly.
Jonathan G Comment by Jonathan G on February 4, 2010 at 6:22pm
I set the following parameters at the top of the script:
remote=10.10.99.99
port=8182
user=admin
password=

I also changed "http" to "https"

When I execute, it fails:
./clone_im.sh
mv: cannot stat `Preferences': No such file or directory

Which means:
1. it is failing all the way at the end of the script
2. I don't see the first portion of the script as having executed?
3. Why do I need to copy "InterMapper_Settings" using curl and this script? Why not just execute an "scp" command in cron every night, from live server to backup server?

© 2010   Created by Community Admin | Dartware, LLC develops the InterMapper® network monitoring software with an integrated NetFlow analyzer. InterMapper network management software earns a quick return on investment by proactively alerting administrators to potential slow-downs, crashes, and other business interruptions. Its real-time, color-coded maps and other displays provide users with an instant view of their network including device status and bandwidth usage. Dartware's software is installed in financial services, healthcare, retail, education, government, non-profit, WISP and ISP organizations around the world.

Badges  |  Report an Issue  |  Privacy  |  Terms of Service

InterMapper.com iMapper Community