Ubuntu 安装 zabbix-get,Command 'zabbix_get' not found 解决办法

背景

在上回 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 
Responses
  1. I have been exploring for a little for any high quality articles or weblog posts in this kind of area . Exploring in Yahoo I eventually stumbled upon this web site. Reading this information So i am glad to convey that I've an incredibly excellent uncanny feeling I came upon exactly what I needed. I most for sure will make certain to do not forget this web site and provides it a glance on a constant basis.

    Reply
  2. I simply could not leave your website prior to suggesting that I extremely enjoyed the standard information an individual supply in your visitors? Is going to be back steadily in order to check out new posts

    Reply
  3. Hello, just wanted to tell you, I loved this blog post. It was inspiring. Keep on posting!

    Reply
  4. I got this site from my pal who shared with me on the topic of this web page and at the moment this time I am browsing this web page and reading very informative articles here.

    Reply
  5. Heya i am for the first time here. I came across this board and I find It truly useful & it helped me out much. I hope to give something back and aid others like you aided me.

    Reply
  6. WOW just what I was looking for. Came here by searching for onewin

    Reply