LoginSignup
1
2

More than 3 years have passed since last update.

Zabbix 特定ユーザの指定アプリ(プロセス)のメモリ使用量を監視したい

Last updated at Posted at 2020-06-15
  • 普段使うアイテムはこちら
perf_counter["\Process(explorer)\Working Set"]

新規アイテム

  • 例)ユーザ:app_user、アプリ:explorer(.exe)

  • まず、cmdでテスト

tasklist /fi "USERNAME eq app_user" /fi "IMAGENAME eq explorer.exe"

@echo off & for /f "tokens=5 skip=3" %i in ('tasklist /fi "USERNAME eq app_user" /fi "IMAGENAME eq explorer.exe"') do set line=%i & echo %line:,=% & exit /B 0

できるだけPowerShellにしたい

  • アイテム
    • タイプ: Zabbixエージェント(アクティブ)
    • データ型: 数値 (整数)
    • 単位: B
    • キー
system.run[PowerShell "(Get-Process -Name explorer -IncludeUserName | Where-Object { @('app_user') -contains $_.UserName }).WS"]

or

system.run[PowerShell "(Get-Process -Name explorer -IncludeUserName | ? { @('app_user') -contains $_.UserName }).WS"]

参考

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2