Ad Widget

Collapse

commnad to stop zabbix agent

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • paragpalkhe
    Junior Member
    • Aug 2019
    • 2

    #1

    commnad to stop zabbix agent

    I use following command to start the zabbix agent

    /opt/app/zabbix_agent/sbin/zabbix_agentd

    What is the command to stop the agent gracefully using the zabbix command ?

    (the zabbix agent is owned by application owner so systemctl start / stop is no good)

    Please let me know how do you deal with this.
  • Markku
    Senior Member
    Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
    • Sep 2018
    • 1781

    #2
    Hi, you can kill it. This is from an install done using Zabbix repo:

    Code:
    $ [B]systemctl status zabbix-agent | grep loaded[/B]
    Loaded: loaded (/lib/systemd/system/zabbix-agent.service; enabled; vendor preset: enabled)
    $ [B]cat /lib/systemd/system/zabbix-agent.service[/B]
    [Unit]
    Description=Zabbix Agent
    After=syslog.target
    After=network.target
    
    [Service]
    Environment="CONFFILE=/etc/zabbix/zabbix_agentd.conf"
    EnvironmentFile=-/etc/default/zabbix-agent
    Type=forking
    Restart=on-failure
    PIDFile=/run/zabbix/zabbix_agentd.pid
    KillMode=control-group
    ExecStart=/usr/sbin/zabbix_agentd -c $CONFFILE
    [B]ExecStop=/bin/kill -SIGTERM $MAINPID[/B]
    RestartSec=10s
    
    [Install]
    WantedBy=multi-user.target
    One way is using "killall zabbix_agentd".

    Markku

    Comment

    • paragpalkhe
      Junior Member
      • Aug 2019
      • 2

      #3
      Thanks for your reply. I will continue to kill the processes using kill command however just wanted to know if there is any better way to stop them gracefully other than systemctl stop. Thanks again for your help.

      Comment

      Working...