Hi community
I created this script in powershell
PS C:\Users\user> ps -IncludeUserName|? UserName -m "$env:USERNAME" | sort -Descending cpu | select -f 10 | ft -AutoSize
the output is
Handles WS(K) VM(M) CPU(s) Id UserName ProcessName
------- ----- ----- ------ -- -------- -----------
599 46456 324 3.169,28 4120 DOMAIN\user1 fshoster32
2079 88860 577 2.072,28 3416 DOMAIN\user2 explorer
353 69308 680 89,66 2660 DOMAIN\user3 InetMgr
210 25916 127 82,11 7728 DOMAIN\user4 notepad++
762 83928 383 36,13 8212 DOMAIN\user5 iexplore
581 33496 190 30,89 3420 DOMAIN\user6 iexplore
300 11496 253 27,56 5804 DOMAIN\user7 taskhostex
316 10096 91 20,00 8156 DOMAIN\user8 rdpclip
418 80240 640 9,31 1112 DOMAIN\user9 powershell
147 7204 95 4,31 1372 DOMAIN\user10 ClassicStartMenu
I need to get this text as is in and get it in the alerts message send it by email when occurs for example load average in server reach 10 to know who is and take action, is possible?
and when I execute on windows works.
c:\Zabbix\bin\get_process_users.ps1
in configuration agent I got
UserParameter=GetProcessUsers,c:\Zabbix\bin\get_pr ocess_users.ps1
I restart ok the agent on windows but can't get anything on linux server
$ zabbix_get -s 192.168.1.100 -p 10050 -k "GetProcessUsers"
no output
$ zabbix_get -s 192.168.1.100 -p 10050 -k "system.run[powershell.exe -File 'c:\Zabbix\bin\get_process_users.ps1']"
Processing -File ''c:\Zabbix\bin\get_process_users.ps1'' failed: The given path's format is not supported. Specify a valid path for the -File parameter.
Windows PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.
In the other hand I need put this information in a grapfic to see in the history line if some users put the load times ago either.
it's possible this too?
thanks in advance for any help
I created this script in powershell
PS C:\Users\user> ps -IncludeUserName|? UserName -m "$env:USERNAME" | sort -Descending cpu | select -f 10 | ft -AutoSize
the output is
Handles WS(K) VM(M) CPU(s) Id UserName ProcessName
------- ----- ----- ------ -- -------- -----------
599 46456 324 3.169,28 4120 DOMAIN\user1 fshoster32
2079 88860 577 2.072,28 3416 DOMAIN\user2 explorer
353 69308 680 89,66 2660 DOMAIN\user3 InetMgr
210 25916 127 82,11 7728 DOMAIN\user4 notepad++
762 83928 383 36,13 8212 DOMAIN\user5 iexplore
581 33496 190 30,89 3420 DOMAIN\user6 iexplore
300 11496 253 27,56 5804 DOMAIN\user7 taskhostex
316 10096 91 20,00 8156 DOMAIN\user8 rdpclip
418 80240 640 9,31 1112 DOMAIN\user9 powershell
147 7204 95 4,31 1372 DOMAIN\user10 ClassicStartMenu
I need to get this text as is in and get it in the alerts message send it by email when occurs for example load average in server reach 10 to know who is and take action, is possible?
and when I execute on windows works.
c:\Zabbix\bin\get_process_users.ps1
in configuration agent I got
UserParameter=GetProcessUsers,c:\Zabbix\bin\get_pr ocess_users.ps1
I restart ok the agent on windows but can't get anything on linux server
$ zabbix_get -s 192.168.1.100 -p 10050 -k "GetProcessUsers"
no output
$ zabbix_get -s 192.168.1.100 -p 10050 -k "system.run[powershell.exe -File 'c:\Zabbix\bin\get_process_users.ps1']"
Processing -File ''c:\Zabbix\bin\get_process_users.ps1'' failed: The given path's format is not supported. Specify a valid path for the -File parameter.
Windows PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.
In the other hand I need put this information in a grapfic to see in the history line if some users put the load times ago either.
it's possible this too?
thanks in advance for any help
Comment