Jump to content
dbeckwitt

Add all live IP's to Notifications

Recommended Posts

I've written a script to scan the network and insert all existing active IP addresses to the proper location in the registry, however Pulseway manager doesn't pick that up (even on service restart).
Where do I need to insert those changes?

Sample script below- It relys on a txt file for a list of active IP's (generated separately)

 

cls
# Remove any existing registry entries
$ExistingKeys = Get-ChildItem "HKLM:\Software\MMSOFT Design\PC Monitor\DevicesPingResponses\" | Select-Object -expand Name
$Count = 0
ForEach ($Key in $ExistingKeys){
  Remove-Item "HKLM:\Software\MMSOFT Design\PC Monitor\DevicesPingResponses\Device$Count"
  $Count++
 }

#Load List of IP's to monitor and insert values into registry
$IPList = Get-Content "C:\updates\IPList.txt"
$Count = 0;
foreach ($IP in $IPList) {
    New-Item "HKLM:\Software\MMSOFT Design\PC Monitor\DevicesPingResponses\Device$Count";
    Set-ItemProperty -Path "HKLM:\Software\MMSOFT Design\PC Monitor\DevicesPingResponses\Device$Count" -Name ("Address") -Type String -Value $IP;
    Set-ItemProperty -Path "HKLM:\Software\MMSOFT Design\PC Monitor\DevicesPingResponses\Device$Count" -Name ("AliasName") -Type String -Value "Camera $Count";
    Set-ItemProperty -Path "HKLM:\Software\MMSOFT Design\PC Monitor\DevicesPingResponses\Device$Count" -Name ("Priority1") -Type String -Value 2;
    Set-ItemProperty -Path "HKLM:\Software\MMSOFT Design\PC Monitor\DevicesPingResponses\Device$Count" -Name ("Priority2") -Type String -Value 1;
    Set-ItemProperty -Path "HKLM:\Software\MMSOFT Design\PC Monitor\DevicesPingResponses\Device$Count" -Name ("ResponseMinutes") -Type String -Value 1;
    Set-ItemProperty -Path "HKLM:\Software\MMSOFT Design\PC Monitor\DevicesPingResponses\Device$Count" -Name ("ResponseTime") -Type String -Value 300;
    Set-ItemProperty -Path "HKLM:\Software\MMSOFT Design\PC Monitor\DevicesPingResponses\Device$Count" -Name ("UseAlias") -Type String -Value 0;
    $Count++
    
    }

exit 0;

 

Share this post


Link to post
Share on other sites

Hi @dbeckwitt,

You will need to update the count of currently active Ping monitoring under that registry key.

 HKEY_LOCAL_MACHINE\SOFTWARE\MMSOFT Design\PC Monitor\DevicesPingResponses\Count

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...