Jump to content
Przemyslaw Klys

PowerShell Module to manage configuration of Pulseway Manager

Should development continue?  

You do not have permission to vote in this poll, or see the poll results. Please sign in or register to vote in this poll.

Recommended Posts

A bit of introduction:

I'm a happy user of Pulseway Manager. I use Pulseway Manager Enterprise (but for this topic it doesn't really matter). I manage quite large deployment with 250 Pulseway monitored machines. Someone else installed (via GPO) and did some basic setup. After running basic setup for a while, someone else changed some settings and tweaked it a bit. Finally ... again someone said lets change things around... 

This got me to this point... I have to change:

CPU

  • For all servers CPU > 90% for 30minutes > CRITICAL

RAM

  • RAM on 1 HOST – 5% for 30 min > CRITICAL
  • Disable Low RAM on VM's
  • Disable Low RAM in Azure

Enable storage for any drives the servers have

  • 20GB free > ELEVATED
  • 10GB free > CRITICAL

While I could just assign some poor guy to go thru 60+ servers and change things, make sure those are correct I decided it's time to introduce PowerShell for those Active Directory admins out there... while I know there is Pulseway GPO but it's kind of limited, and doesn't give much flexibility (for example drive monitoring). It also overwrites settings set locally without Pulseway actually showing them on Client.  

After playing a bit...  I managed to write:

Clear-Host
Import-Module PSPulsewayManager -Force
 
### Tests - Account Page ###
Get-PulsewayMaintenanceMode
Set-PulsewayMaintenanceMode -Toggle $false -Verbose
Get-PulsewayGroupName
Set-PulsewayGroupName -GroupName 'EVOTEC' -Verbose
Get-PulsewayComputerName
Set-PulsewayComputerName -NewComputerName 'EVO1' -Verbose
 
### Set settings remotly...
 
$Computer = 'AD1'
Get-PulsewayMaintenanceMode -Computer $Computer
Set-PulsewayMaintenanceMode -Computer $Computer -Toggle $false -Verbose
Get-PulsewayGroupName -Computer $Computer
Set-PulsewayGroupName -Computer $Computer -GroupName 'EVOTEC' -Verbose
Get-PulsewayComputerName -Computer $Computer
Set-PulsewayComputerName -Computer $Computer -NewComputerName 'AD1' -Verbose

And another tab... 

Clear-Host
Import-Module PSPulsewayManager -Force
Import-Module PSWriteColor
 
### Tests - Notifications Performance Page ###
 
Write-Color ' Get ', 'CPU usage below', ' settings' -Color Yellow, Green, Yellow
Get-PulsewayCPUBelow
Write-Color ' Get ', 'CPU usage above', ' settings' -Color Yellow, Green, Yellow
Get-PulsewayCPUAbove
Write-Color ' Get ', 'Memory', ' settings' -Color Yellow, Green, Yellow
Get-PulsewayMemoryLow
Write-Color ' Get ', 'Port Closed', ' settings' -Color Yellow, Green, Yellow
Get-PulsewayMonitoredPortClosed
 
Set-PulsewayCPUAbove -CPUUsagePercentage 25 -CPUUsageTimeInterval 20 -PrioritySendNotificationOnCPUUsage Elevated -SendNotificationOnCPUUsage Enabled -Verbose
Set-PulsewayCPUBelow -BelowCPUUsagePercentage 2 -BelowCPUUsageTimeInterval 20 -PrioritySendNotificationOnBelowCPUUsage Elevated -SendNotificationOnBelowCPUUsage Disabled -Verbose
Set-PulsewayMemoryLow -LowMemoryPercentage 10 -LowMemoryTimeInterval 15 -PrioritySendNotificationOnLowMemory Critical -SendNotificationOnLowMemory Enabled -Verbose
Set-PulsewayMonitoredPortClosed -PortInterval 2 -PrioritySendNotificationOnPortNotAccessible Critical -SendNotificationOnPortNotAccessible Enabled -Verbose

And another tab

Clear-Host
Import-Module PSPulsewayManager -Force
Import-Module PSWriteColor
 
$Computer = 'AD1'
 
Write-Color 'Get ', 'Low Disk Space' -Color White, Yellow
$Drives = Get-PulsewayLocalDiskSpace -Computer $Computer
$Drives
Write-Color 'List ', ' drives separatly' -Color White, Yellow -LinesAfter 1
$Drives.MonitoredDrives
 
## Find all drives for computer/server
$FindDrives = Get-Drive -Computer $Computer
$FindDrives
$ListDrives = @()
# Set the settings for all drives for particular computer/server (Elevated)
$DrivesElevated = Set-DriveSettings -Drive $FindDrives -Percentage 10 -Priority Elevated -SizeMB 20000 -UsePercentage No
# Repeat process for same drives but make it critical
$DrivesCritical = Set-DriveSettings -Drive $FindDrives -Percentage 10 -Priority Critical -SizeMB 10000 -UsePercentage No
 
$ListDrives += $DrivesElevated
$ListDrives += $DrivesCritical
 
Set-PulsewayLocalDiskSpace -Computer $Computer -Drives $ListDrives -SendNotificationOnLowHDDSpace Enabled -Verbose

Since it covers my needs for now I was wondering if there is any interest in this? I don't want to spend time on it if there's no one else needing this :)

 

I've published it on github

https://github.com/EvotecIT/PSPulsewayManager

But its also published in PowerShellGallery which allows you to install it ....

Install-Module PSPulsewayManager

Import-Module PSPulsewayManager 

Use the commands.. Keep in mind I've not spent a ton of time on it. There are bugs, some things are not checked.. but it does work ;-) 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • By MaxITGarrett
      Our business operates with hundreds of products in our inventory and going through all of them and manually entering them into PSA was not exactly an option, and without an import function, I had to develop an import tool that uses the PSA API. I developed it originally with hard coded parameters, in a single class, but went back today and improved it for distribution to everyone here.
      To view the source code, check out the repository at https://bitbucket.org/garrettbromley/pulseway-product-import/
      To download the executable files, download PulsewayProductImport-v2.zip at https://bitbucket.org/garrettbromley/pulseway-product-import/downloads/
       
      Instructions:
      Download the Excel template and add your inventory into that sheet. I personally had a Microsoft Surface that I walked around with and inventoried everything. To change the categories/sub categories, open the "Back End" tab on the sheet and edit those tables to your liking The only column that isn't required is the UPC Code. Run the Import Tool Input your PSA credentials Type in the full directory to the excel sheet (make sure its closed before running it) Confirm the number of detected items Watch the tool work Make a stock adjustment with the levels of stock for each item (this unfortunately cannot be automated) It will notify you how many items have successfully been imported and which ones failed (if any) and why.  
      Please let me know if you have any questions! I will post changelogs if any updates are made.
    • By pete_harris
      Does anyone have or know how to create a script to disable Password Protected Sharing in Windows 10. This has become a real issue for me as every time Microsoft has an update the default is "Turn on password protected sharing" which forces me to do a lot of tweaks.
      Thanks in advance,
      Pete
    • By MaxITGarrett
      We currently use TeamViewer as our remote support software and like to have Pulseway as a backup to that, but one thing that we like to do is record our sessions for both accountability and to have the ability to reference something we have done in the past to resolve an issue or to double check one's work.
      If Pulseway is to compete with this, I would like to see the ability to record these sessions.
    • By MaxITGarrett
      Not sure how many people use 3CX for their phone systems, but our company utilizes the system and have recently adopted Pulseway as well. As a result, I have developed a plugin for 3CX Windows Client that opens a ticket as you pick up the phone from an incoming call. I have included the source code for reference if anyone else has a need for it.
      Instructions:
      Create a new project. Select C# Language and create a new “Windows Class Library” project. Ensure that the project targets .NET Framework 4.5.1 Add a reference to the library “MyPhoneCRMIntegration.dll” installed with 3CXPhone for Windows (usually C:\ProgramData\3CXPhone for Windows\PhoneApp). Rename Class1.cs to PulsewayTicketPlugin.cs and replace the code with the following: using System; using System.IO; namespace _PulsewayTicketPlugin { [MyPhonePlugins.CRMPluginLoader] public class PulsewayTicketPlugin { // Initialization of Variables private static PulsewayTicketPlugin instance = null; // Holds the instance private MyPhonePlugins.IMyPhoneCallHandler callHandler = null; // Holds the handler private static MyPhonePlugins.CallState lastStatus = MyPhonePlugins.CallState.Undefined; // Holds the last relevant phone status // Called upon loading 3CX Client [MyPhonePlugins.CRMPluginInitializer] public static void Loader(MyPhonePlugins.IMyPhoneCallHandler callHandler) { // Create a new instance of the plugin instance = new PulsewayTicketPlugin(callHandler); } // Constructor for plugin, to add event handler private PulsewayTicketPlugin(MyPhonePlugins.IMyPhoneCallHandler callHandler) { this.callHandler = callHandler; // As the status of the call changes, process the changes callHandler.OnCallStatusChanged += new MyPhonePlugins.CallInfoHandler(callHandler_OnCallStatusChanged); } // Processes the status of the call private void callHandler_OnCallStatusChanged(object sender, MyPhonePlugins.CallStatus callInfo) { // Process the current state // - If it is ringing, a call is incoming, so we want to monitor it // - If it has ended, no longer need to monitor it (happens when we end it or someone else picks it up) // - Don't process other cases, not necessary switch (callInfo.State) { case MyPhonePlugins.CallState.Ended: { lastStatus = MyPhonePlugins.CallState.Undefined; break; }; case MyPhonePlugins.CallState.Ringing: { lastStatus = MyPhonePlugins.CallState.Ringing; break; }; default: { break; }; } // If the phone was ringing and we picked it up, open a new ticket if (lastStatus == MyPhonePlugins.CallState.Ringing && callInfo.State == MyPhonePlugins.CallState.Connected) { // Windows will automatically use the default application used to open URL's System.Diagnostics.Process.Start("https://psa.pulseway.com/MSP/TicketEdit.aspx"); } } } } Build the DLL and place it into the 3CX Phone Directory (C:\ProgramData\3CXPhone for Windows\PhoneApp). Edit the 3CX Phone Configuration file (C:\ProgramData\3CXPhone for Windows\PhoneApp\3CXWin8Phone.user.config) and add the following: <add key="CRMPlugin" value="CallNotifier,3CXPhoneTapiPlugin,PulsewayTicketPlugin"/> Reload your 3CX Windows Client and it should work with the next incoming call!
×