Local and remote system monitor gadget

  • Number of votes: 18
  • Views: 6074
  • Average rating:

Syndication and Sharing

My entry for the EPiServer gadget contest is a system monitor. I wanted to provide administrators/developers a quick way of checking the health of a local or remote server at a glance. I wanted:

  • A gadget that gave the user control of what they wanted to monitor on a local or remote system
  • A visually pleasing way of presenting core system information (CPU load, memory usage and disk space)

The gadget allows users to specify what to monitor and where to monitor it:

Config

By adding a couple of instances of my gadget its possible to build up a simple dashboard that allows users to see what is going on with their server:

Gadget screen 

Users can set through configuration the critical threshold which is used when deciding what colour to use for memory and disk usage.

By supplying the appropriate credentials  it possible to monitor remote machines (The screen shot shows the gadget running on my local machine but monitoring a remote machine (highlighted)):

RemoteDisplay

Points of interest

There are a couple of interesting points about the gadget. Windows Management Instrumentation (WMI) is used to retrieve the system information (either locally or remotely). However the default ASP.net account does not have the required permissions to access some of the counters (such as CPU load) locally. Therefore I needed to temporarily elevate the permissions to those of the user credentials collected when first starting the gadget. Fortunately for me Shakti Singh Tanwar had already written a post of how to do this: http://forums.asp.net/p/1458098/3343489.aspx so I extend my gratitude to him. Also WMI is a huge area, its possible to collect information about your system in eye watering detail. For my gadget I decided to stick with some basic monitoring. However a full list of available classes are available on MSDN here: http://msdn.microsoft.com/en-us/library/aa394084%28VS.85%29.aspx.

In order to create visually pleasing charts I used the Google charts API http://code.google.com/apis/chart/. I like this API as its free, offers a simple way of generating decent looking charts and it doesn't require an API key.

Also in order get access to the model in the javascript I had to use some inline script in the views which I think is not the ideal way of doing things. It would be great if anyone could offer any insight on a better way of doing this within the EPiServer Gadget framework?

Conclusion

The gadget gives users control of what they want to monitor and where they want to monitor it. The gadget can be extended to include any kind of metrics you like. I'd be interested to hear of any additions and/or bugs!

Source code is available here [download] 59k, zip

An installer is available here [download] 19k, zip

Troubleshooting

If you are having trouble getting access to remote computers using WMI then Microsoft provide some WMI diagnosis tools: http://www.microsoft.com/downloads/details.aspx?familyid=d7ba3cd6-18d1-4d05-b11e-4c64192ae97d&displaylang=en.

I found the best way of troubleshooting was using dcomcnfg.exe and checking the permissions on “My Computer”.

Comments

  • (By David Knipe , 21 September 2010 10:32, Permanent link)

    Note for EPiServer World admins. It appears that tags dissappear when re-publishing in Windows Live Writer. Can you re-add the following tags?:

    Gadget Contest 2009, EPiServer CMS 6 CTP2, EPiServer CMS 6.0, EPiServer CMS 6

    Many thanks

  • (By Per Hemmingson , 21 September 2010 10:32, Permanent link)

    Great gadget! I think its very useful for site admins!