ContributionsMost RecentMost LikesSolutionsRe: Using an External Script DataSource to run Powershell script Hi Stuart, I want to run the powershell using latest version 7, but Logic monitor does not have an option to choose the version of Powershell in its dashboard. So I am trying to run it externally. Using an External Script DataSource to run Powershell script Using an External Script DataSource to run Powershell script Attached the configuration I have, If I have to run on a different machine how do I specify the hostname ? Re: Output representation for each process name in Logicmonitor My collector script prints the data like below Application_Name1##CPU_Percentage Application_Name2##CPU_Percentage So what should I place in collector attributes script to store data ? Re: Output representation for each process name in Logicmonitor Can you please provide any example of the Collector attributes script as reference for better understanding ? Re: Output representation for each process name in Logicmonitor In this setup for multi-instance, active discovery method, there are 2 blocks for adding Powershell script. 1st block after Active discover option parameters and 2nd block after Collector attributes. What should be placed in the collector attributes script block ? Re: Output representation for each process name in Logicmonitor >>>>>>> Just to check some basics: this is a multi-instance, BATCHSCRIPT DS and you have active discovery enabled. Right? Yes, Correct multi-instance and active discovery enabled. >>>>>>>>> It looks like you put your collection script into the active discovery script section. Your ActiveDiscovery script should be outputting the ID and name of the application in this format: It is in below format: Application_Name1##CPU_Percentage Application_Name2##CPU_Percentage Output representation for each process name in Logicmonitor I am running a powershell script to get the CPU utilization of each process and it is showing when running test script as attached to this question. To store it in device it is showing as percentage of CPU and not application name. How to store as application name ? Can someone help on how to save each application CPU utilization in Logicmonitor as every time some application may be having utilization and some may not ? Change Powershell version in Logicmonitor I have powershell version 5.1 and 7.1 in my collector and I want to use 7.1 for executing the scripts. How to choose that option from Logic monitor ? How to change the Powershell version in Logic Monitor ? Re: when running the script using gwmi it just timeout without returning anything the default wmi query calls from Logic monitor is able to poll data, but when adding a powershell script to poll data it is getting timedout. Do we need any specific option or setting to enable or is it due to some other issues ? Re: when running the script using gwmi it just timeout without returning anything I am using below powershell script to run and gather citrix Active and Disconnected sessions count. I can gather the data from some machines and it simply doesn't return anything on some machines. When I run poll it says timeout from Logic monitor, so the question I have is how do we find out is the problem with powershell script or with Logic monitor as the script runs fine when run locally on each machine in powershell ISE. try { $icacgpactive = 0 $icacgpdisc = 0 $Citrix_Connect = [ordered]@{} Get-CimInstance -Namespace ROOT\citrix\EUEM -Query "SELECT * FROM Citrix_Euem_ClientConnect" -ComputerName ##system.hostname## -OperationTimeoutSec 1 -ErrorAction Stop | ForEach-Object { $Citrix_Connect.Add($_.Username, $_.WinstationName) } $Citrix_Disconnect = [ordered]@{} Get-CimInstance -Namespace ROOT\citrix\EUEM -Query "SELECT * FROM Citrix_Euem_ClientDisconnect" -ComputerName ##system.hostname## -OperationTimeoutSec 1 -ErrorAction Stop | ForEach-Object { $Citrix_Disconnect.Add($_.Username, $_.WinstationName) } foreach($k in $Citrix_Connect.Keys) { if( $Citrix_Disconnect[$k] -eq "") { if ($Citrix_Connect[$k] -like "ica-cgp#*") { $icacgpactive += 1 } } elseif($Citrix_Disconnect[$k] -eq $Citrix_Connect[$k]) { if ($Citrix_Disconnect[$k] -like "ica-cgp#*") { $icacgpdisc += 1 } } else { if ($Citrix_Connect[$k] -like "ica-cgp#*") { $icacgpactive += 1 } } } Write-Host "ICACGPActive:$icacgpactive" Write-Host "ICACGPDisc:$icacgpDisc" $Exitcode = 0 Write-host "Exitcode:$Exitcode" } catch { $_.Exception $Exitcode = 1 Write-host "Exitcode:$Exitcode" }
Top ContributionsChange Powershell version in LogicmonitorRe: Using an External Script DataSource to run Powershell scriptUsing an External Script DataSource to run Powershell scriptRe: Output representation for each process name in LogicmonitorRe: Output representation for each process name in LogicmonitorRe: Output representation for each process name in LogicmonitorRe: Output representation for each process name in LogicmonitorOutput representation for each process name in LogicmonitorGet CPU Percentage for all processes using PowerShellRe: when running the script using gwmi it just timeout without returning anything