美文网首页
Ubuntu 安装 zabbix-get,Command 'za

Ubuntu 安装 zabbix-get,Command 'za

作者: HongXunPan | 来源:发表于2020-03-09 23:59 被阅读0次

    背景

    在上回 Ubuntu 安装 nginx 版 zabbix 之后,执行 zabbix_get 提示命令不存在:

    [root@Ubuntu:zabbix]# zabbix_get -s 127.0.0.1 -k 'nginx.status[ping]'
    
    Command 'zabbix_get' not found, but can be installed with:
    
    apt install zabbix-proxy-mysql  
    apt install zabbix-proxy-pgsql  
    apt install zabbix-proxy-sqlite3
    apt install zabbix-server-mysql 
    apt install zabbix-server-pgsql 
    
    

    解决方法

    apt 安装 zabbix-get

    [root@Ubuntu:~]# apt install zabbix-get
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    The following NEW packages will be installed:
      zabbix-get
    0 upgraded, 1 newly installed, 0 to remove and 13 not upgraded.
    Need to get 72.7 kB of archives.
    After this operation, 249 kB of additional disk space will be used.
    ionic [72.7 kB]
    Fetched 72.7 kB in 0s (222 kB/s)
    
    Selecting previously unselected package zabbix-get.
    (Reading database ... 106406 files and directories currently installed.)
    Preparing to unpack .../zabbix-get_1%3a5.0.0~alpha2-1+bionic_amd64.deb ...
    Unpacking zabbix-get (1:5.0.0~alpha2-1+bionic) .................................................] 
    Setting up zabbix-get (1:5.0.0~alpha2-1+bionic) ...######.......................................] 
    Processing triggers for man-db (2.8.3-2ubuntu0.1) ...##############################.............] 
    
    

    之后就可以愉快地执行 zabbix_get

    [root@Ubuntu:zabbix]# zabbix_get -s 127.0.0.1 -k 'php-fpm.status[ping]' 
    0
    [root@Ubuntu:zabbix]# zabbix_get -s 127.0.0.1 -k 'php-fpm.status[conn]'
    15743
    

    切记

    安装的是 zabbix-get !而不是 zabbix_get,否则会出现以下情况

    [root@Ubuntu:zabbix]# apt install zabbix_get
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    E: Unable to locate package zabbix_get
    [root@Ubuntu:zabbix]# which zabbix_get
    [root@Ubuntu:zabbix]# 
    [root@Ubuntu:zabbix]# zabbix_get -s 127.0.0.1 -k 'nginx.status[ping]'
    
    Command 'zabbix_get' not found, but can be installed with:
    
    apt install zabbix-proxy-mysql  
    apt install zabbix-proxy-pgsql  
    apt install zabbix-proxy-sqlite3
    apt install zabbix-server-mysql 
    apt install zabbix-server-pgsql 
    
    

    相关文章

      网友评论

          本文标题:Ubuntu 安装 zabbix-get,Command 'za

          本文链接:https://www.haomeiwen.com/subject/pcbvdhtx.html