Kris Springer's Tech Blog - Xymon Powershell Client
Xymon Powershell Client
11-28-18 Kris Springer
I love my Xymon server. It gathers all sorts of data and graphs it and notifies me of issues. As a tech it's the one tool that I always implement with any client/employer that I'm involved with. I started using it way way back in the day when it was called Big Brother, and I'm still using it today, 20 years later. Information is the key to being a good tech. When collecting data from Windows machines I used to use the BBWin client, but times and OS's have changed significantly, so the Xymon Powershell Client is what I currently use. It has it's limitations but for the core data that needs collected. I can even push/run additional Powershell scripts from my xymon server out to the client's without having to touch the client directly. It's great! Here's my installation instructions with some additional goodies at the end.
I'm assuming you already have a functioning Xymon Server that can collect data, and that you know how to edit it's 'hosts' file.
Data is sent out from the client on the default port 1984. If the network blocks that there is a way to use 443, but it takes some additional customization on both the server and client. See details for that below.
If BBwin was previously installed on the client machine you need to stop the service, disable it, and/or delete BBwin altogether.
If you get purple columns on your server webpage even though the clientdata shows that data is being collected, you need to increase the MAXMSG_CLIENT=1024 amount in 'xymonserver.cfg' on the server and restart the xymon-server service. Basically the PSclient is throwing too much data at the server and it's getting truncated.
You can name a host whatever you want in the Xymon Server ‘hosts’ file, but if your custom name doesn’t match the client’s unique hostname you’ll have to add CLIENT:itsHostname at the end of the line for that host. There is a way to statically define a custom hostname in the client config, but it’s best to use the client’s real hostname.
Custom host test options and tolerance levels can be defined on the Xymon Server in the 'analysis.cfg' file. The PSclient creator's instructions state something different, but currently it doesn't work. When editing the 'analysis.cfg' file on the Xymon server it takes a few cycles for changes to reflect on the dashboard webpage. Don't be alarmed if it takes 15-20 min to see results.
Create C:\Program Files\xymon folder and copy the 3 files into it.
Right-click the files and 'unblock' them. This may not be necessary depending on how you copied the files to the server, but Windows security features usually blocks them because they’re downloaded files.
Edit the xymonclient_config.xml file and define your Xymon server name, path of the log file, and the few other items that you care about. It should look like this.
xymonserver.yourdomainname.comc:\program files\xymon\xymonclient.logc:\program files\xymon\clientconfig.cfg002 3 41c:\program files\xymon\extc:\program files\xymon\tmp
Open a Powershell window in Administrator mode and enter the following command to get the hostname of the client machine. You need this to define it in the Xymon server ‘hosts’ file. This is case sensitive, unique, and how the Xymon server links incoming client data to the name defined on the Xymon webpage.
Run the following commands to install and start the client service.
cd 'C:\Program Files\xymon'
NOTE: if you get a 'scripts disabled' error just run the following command, choose Y for Yes, and then try the install command again.
That's it on the client machine. Now add this new client into your Xymon Server's 'hosts' file and you should see results populating within a minute.
After getting everything working you should zip up your 3 files and stick them somewhere for easy download so you can quickly access them when adding additional client systems later. I added mine as a menu item on my Xymon Server webpage.