Ad Widget

Collapse

Running script on agent

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fgonza1971
    Junior Member
    • Mar 2022
    • 1

    #1

    Running script on agent

    Hi guys hope you're doing great, I've been using Zabbix since 2 months and need to create several monitoring metrics based on this using the Zabbix Agent if its possible all in the same script:

    1. Run a command and send the output to a text file.
    2. Using UserParameter parse the text file to collect each metric.

    I.E.

    uname -a > /etc/zabbix/zabbix_agent.d/checks/kernel.txt
    UserParameter=kernel_version[*], cut -d' ' -f3 /etc/zabbix/zabbix_agent.d/checks/kernel.txt
    UserParameter=kernel_arch[*], cut -d' ' -f12 /etc/zabbix/zabbix_agent.d/checks/kernel.txt

    The command takes between 10-30 secs to execute each time so I want to run this every 2 minutes doing all the tasks each time.

    I've been reading the Zabbix manual but now I'm very confused in how to accomplish this maybe someone could point me in the right direction.

    Regards

    Frank
Working...