Ad Widget

Collapse

How to collect values from powershell script running on windows server?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • eHgwH9
    Junior Member
    • Apr 2021
    • 1

    #1

    How to collect values from powershell script running on windows server?

    Hello,

    I have PowerShell script which generate number from events in event log sinse last 24h.
    I want to visualise this value into zabbix graph, but I don't know how can I do that. I found that zabbix sender could be solution for this. From what have I read it runs on server and it should could send output values from my script.
    But I cannot find "zabbix sender" anywhere...
    I read that it should be part of zabbix agent, but when I install agent on windows, I do not have any additional option like "zabbix sender"...

    Is "zabbix sender" under development or this is something outdated?

    Or maybe there is another way to collect values from PowerShell script and send it to Zabbix?

    Best Regards
  • tim.mooney
    Senior Member
    • Dec 2012
    • 1427

    #2
    zabbix_sender is still perfectly valid, see the current documentation for it: https://www.zabbix.com/documentation...oncepts/sender

    In general, you use zabbix_sender when you want to "push" metrics/data from a client and it's more convenient to gather the metrics using some processing outside of the zabbix_agentd, for example if you have some legacy application running that you can't easily query for metric data from zabbix_agentd, but the legacy application can periodically emit metric data. It can use zabbix_sender to push that data to the Zabbix server. Examples of this are covered in the documentation.

    More traditional custom monitors would use a "UserParameter" configuration with zabbix_agentd to create a custom item key that runs your script periodically. In this scenario, getting the data to the Zabbix server is handled by the zabbix_agentd, and zabbix_sender is not needed.

    If you monitor most of your clients using the default "passive" mode, then ever item the server asks the agent to collect must be collected within a short time limit (usually 5 seconds, though that can be changed with some work). This means that if your powershell script takes longer than 5 seconds to run, you probably couldn't run it as a custom item in a passive check. I don't believe the same time limits are in place for clients that use "Zabbix agent (active)" checks, so that might be something to consider.

    Check the documentation on custom items (user parameters): https://www.zabbix.com/documentation...userparameters

    Comment

    Working...