adding multiple sitescope monitors
Ever needed to setup a heap of sitescope monitors? It’s a pain to do it from the front end for each machine over and over and over.
Luckily the back-end of sitescope is very very simple, there are lots of text files, and if you know what you’re looking for, you’ll find it to be a fairly easy task, and not as time consuming as going through the front end.
You will need access to the server that is hosting sitescope, enough access to read/write files, and the ability to restart services.
Most of the folders in the sitescope directory structure are self explanatory, and the files are easy to modify in a text editor.
There are some limitations to hacking the back end of sitescope to set up mulitple monitors;
You must have ame access to the server you are monitoring (ie. ssh accounts must have the same username and pword)
The monitors are the same for each server you are setting up.
If both these conditions are true, then read on.
Firstly, add a monitor through the front end. In this example I will be adding a Unix Monitor. To do this you will need to add the machine under the REMOTE UNIX menu, then create a monitor with the items you want to monitor.
Ie. CPU utilization, Memory etc.
Once that’s done you can browse your way into the file structure on the server to hack it up.
The only directory we will need is /sitescope/groups
Find the master.config file.
In there you will find a line that begins in _remoteMachine=. Make sure you have word wrap turned off.
_remoteMachine=_secondaryResponse= _disableCache= _initShellEnvironment= _status=connection_successful_some_commands_failed _sshPort=22 _prompt=# _os=HP _id=01 _version2= _passwordPrompt= _trace= _sshClient=java _method=ssh _sshCommand= _keyFile=D:\SiteScope\groups\identity _password=(sisp)CuHnh/6n2jdRI7NeTkq09Q== _sshConnectionsLimit=3 _login=nsingh _host=DRCPRW1 _sshAuthMethod=password _loginPrompt= _secondaryPrompt= _name=DRCPRW1 _remoteEncoding=Cp1252
This block of text is the machine I just added into the front end in the remote unix configuration section. You can duplicate this line as many times as you like ensuring to make changes to the following:
_id – increment by 1
_host – the new host you want add
_name – this should be the same as host, to identify your machines easily.
Once all your hosts are added in you can now duplicate your monitor groups.
Each monitor has a .mg file and a .dyn file.
The .mg file contains the monitor information, the .dyn stores the last metrics that were returned form the server. You do not need to copy the .dyn file, as one will be created automatically.
Example file
_dependsCondition=good _group=IFAPPRC04S _parent=P4DR _nextID=4 _name=IFAPPRC04S _description=Process Server _encoding=Cp1252 _fileEncoding=Cp1252 # _frequency=120 _rawDataOn=false _updateMonitorAndRun=true _thresholdNew=true _internalId=7301534 _perfmonMsmtsProp=<Counters><CounterInfo id="0" Type="Number" Object="CPU utilization" Instance="" Counter="%sys" Description="/usr/bin/sar -ubycwaqvmd 2 2"/><CounterInfo id="1" Type="Number" Object="CPU utilization" Instance="" Counter="%usr" Description="/usr/bin/sar -ubycwaqvmd 2 2"/></Counters> _categoryByAvailability=none _name=IFAPPRC04S CPU _classifier=countersInError > 0 error _classifier=always good _rawDataAvailable=false _defaultStatus=good _machine=remote:08 _dependsCondition=good _class=UnixSystemMonitor _encoding=Cp1252 _rawDataLimit=1048576 _id=1 # _frequency=120 _rawDataOn=false _updateMonitorAndRun=true _thresholdNew=true _internalId=7301535 _categoryByAvailability=none _name=IFAPPRC04S Memory Utilisation _classifier=percentFull > 90 error _classifier=percentFull == 'n/a' error _classifier=percentFull > 80 warning _classifier=always good _rawDataAvailable=false _defaultStatus=good _machine=remote:08 _dependsCondition=good _class=MemoryMonitor _encoding=Cp1252 _rawDataLimit=1048576 _id=2
Duplicate the .mg file and change the following:
_group – Server being monitored
_name – Name of server being monitored
_machine=remote:08 – this is the _id of the machine that was set earlier in the master.configfile.
Once that’s done, restart the sitescope service, and everything will be updated.
Enjoy!
Note that this method (direct modification of mg files) will not be supported in future versions of SiteScope (SiteScope 11 and forward). SiteScope 10.x has a different way to accomplish this task, which is the deployment of templates. Note that if you later want to adjust monitoring, you can modify the template and then publish change. This will add/modify/delete monitors according to the change done in the template.
In SiteScope 10.10, released on July 9 2009, it is possible to deploy templates with input taken from a simple CSV file holding the variables (such as the host names).
Edo Zurel
Operations Manager/SiteScope R&D Manager
HP Business Service Management