I was recently tasked with integrating some datacenter NetBotz cameras with Solarwinds Orion. But if you have disabled guest access to the NetBotz devices and require authentication, it will pop up with a login page each time you refresh your Solarwinds page. I’m not much of a developer so I came up with a solution that prefetches the camera image on the Solarwinds server. Here are the steps you need to follow to get your Netbotz to work with Solarwinds using HTTP authentication:
1. On the monitoring page you want to display your Netbotz stream, hit the Cutomize Page button.
2. Press the Green + sign and add a Custom HTML box under the Miscellaneous category.
3. Now go back to the the monitoring page and hit the edit button on the HTML box you just added.
4. Add this code. This code is set to poll the image from your Solarwinds server every 1 second. Replace “solarwindsserver” with the name of your server in both URLs:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
<!– Netbotz Image Refresh Code Begin –> <IMG src=”http://solarwindsserver/networkatlas/campic.jpg” name=”refresh”> <SCRIPT language=”JavaScript” type=”text/javascript”> <!– var t = 1 // interval in seconds image = “http://solarwindsserver/networkatlas/campic.jpg” //name of the image function Start() { tmp = new Date(); tmp = “?”+tmp.getTime() document.images[“refresh”].src = image+tmp setTimeout(“Start()”, t*1000) } Start(); // –> </SCRIPT> <!– Netbotz Image Refresh Code End –> |
Now you need to setup the image to be staged in the Inetpub directory on the Solarwinds server:
1. Download wget 1.11.4 (http://users.ugent.be/~bpuype/wget/)
2. Copy wget to the Inetpub folder. I chose to put in in an existing directory: C:\Inetpub\SolarWinds\NetworkAtlas
3. Create a new file in this directory called cam.vbs. The contents of this VBscript file should be:
1 2 3 4 5 |
Set WshShell = WScript.CreateObject("WScript.Shell") Do WshShell.Run ("wget -m -nd --http-user=admin --http-passwd=password <a href="http://xxx.xxx.xxx.xxx/images/nbEyeEnc_0_CAMERA/VGA/campic.jpg">http://xxx.xxx.xxx.xxx/images/nbEyeEnc_0_CAMERA/VGA/campic.jpg</a>") WScript.Sleep(1000) Loop |
Depending on what model Netbotz or Wallbotz you have, the URL will change. nbEyeEnc_0 denotes the integrated cam on a Netbotz. You can easily grab your exact URL by logging into the Netbotz normally and right clicking, going to properites, and copying the URL for the image you want. The VBscript uses wget to go out to the Netbotz, authenticate, and download the image to the Solarwinds web server every 1 second. You can adjust the time by changing the 1000 to however many milliseconds you want.
4. Now create a scheduled task in Task Scheduler and point it at C:\Inetpub\SolarWinds\NetworkAtlas\cam.vbs
. Set it to run on system startup. Run it manually if you like to get it going.
Done! Now if you visit your monitoring page, you should see a live stream from your locked down NetBotz! Added bonus your camera credentials are not exposed in your code in plain text and the performance hit on the server from this script running every second is only 6 MB.
Here’s a composite image of what your integration will look like.
Tyler M
October 23, 2013 at 9:42 AM
Thanks for this but your vbscript does not run. It gives an error that its expecting a bracket. See the image.
Thanks.