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. We're a gaggle of volunteers and opening a new scheme in our community. Your website provided us with useful info to work on. You've performed an impressive task and our entire group shall be thankful to you.

    Reply
  2. Excellent blog! Do you have any suggestions for aspiring writers? I'm hoping to start my own website soon but I'm a little lost on everything. Would you propose starting with a free platform like Wordpress or go for a paid option? There are so many options out there that I'm completely confused .. Any recommendations? Cheers!

    Reply
  3. What's up, all is going sound here and ofcourse every one is sharing information, that's really good, keep up writing.

    Reply
  4. Hey terrific website! Does running a blog similar to this require a massive amount work? I've no knowledge of coding but I had been hoping to start my own blog in the near future. Anyhow, if you have any recommendations or techniques for new blog owners please share. I understand this is off topic but I simply wanted to ask. Appreciate it!

    Reply
  5. Right here is the perfect webpage for anybody who wishes to understand this topic. You know a whole lot its almost hard to argue with you (not that I really will need to…HaHa). You certainly put a new spin on a subject that has been written about for years. Wonderful stuff, just wonderful!

    Reply
  6. Whats up are using Wordpress for your site platform? I'm new to the blog world but I'm trying to get started and create my own. Do you need any coding knowledge to make your own blog? Any help would be really appreciated!

    Reply