配置自定义监控K值时,出现下面错误提示

[root@manage ~]# zabbix_get -s 101.221.155.218 -p  -k "login_user"
zabbix_get []: Check access restrictions in Zabbix agent configuration

可能性一、zabbix_get命令使用场景

zabbix的服务器端与客户端连接的主要工具就是zabbix里bin文件夹下的zabbix_get文件,这个命令只能在zabbix的server端使用,如果在agent端使用就会提示如下的错误:
zabbix_get []: Check access restrictions in Zabbix agent configuration

可能性二、未连接zabbix客户端

zabbix_get命令使用方法:
zabbix_get -s 127.0.0.1 -p -k "system.cpu.load[all,avg1]"

注意:  -s后面接的是目标地址,-p后面要加端口号,这个一般都是10050, -I 后面加原地址,不过这个一般用不上,-k 后面接的就是item项目里的key。

如果zabbix客户端配置的是内网地址,那么这里使用公网地址,也会出现“Check access restrictions in Zabbix agent configuration”的问题;这里的-k注意必须是zabbix_agent.conf中Server配置指向的地址

[root@manage ~]# zabbix_get -s 191.201.185.218 -p  -k "login_user"
zabbix_get []: Check access restrictions in Zabbix agent configuration
#排除客户端连接不通的可能性
[root@manage ~]# ping 191.201.185.218
PING 191.201.185.218 (101.201.185.218) () bytes of data.
bytes from 191.201.185.218: icmp_seq= ttl= time=1.27 ms
bytes from 191.201.185.218: icmp_seq= ttl= time=1.24 ms
##使用zabbix客户端的内网地址,因为我的zabbix_agent.conf配置的是内网地址
[root@manage ~]# zabbix_get -s 10.45.199.182 -p -k "login_user"
##成功获取到K值

zabbix_get使用方法:

[root@manage ~]# zabbix_get -help
usage:
zabbix_get -s host-name-or-IP [-p port-number] [-I IP-address] -k item-key
zabbix_get -s host-name-or-IP [-p port-number] [-I IP-address]
--tls-connect cert --tls-ca-file CA-file
[--tls-crl-file CRL-file] [--tls-agent-cert-issuer cert-issuer]
[--tls-agent-cert-subject cert-subject]
--tls-cert-file cert-file --tls-key-file key-file -k item-key
zabbix_get -s host-name-or-IP [-p port-number] [-I IP-address]
--tls-connect psk --tls-psk-identity PSK-identity
--tls-psk-file PSK-file -k item-key
zabbix_get -h
zabbix_get -V Get data from Zabbix agent. General options:
-s --host host-name-or-IP Specify host name or IP address of a host
-p --port port-number Specify port number of agent running on the host
(default: )
-I --source-address IP-address Specify source IP address -k --key item-key Specify key of the item to retrieve value for -h --help Display this help message
-V --version Display version number TLS connection options:
--tls-connect value How to connect to agent. Values:
unencrypted - connect without encryption
(default)
psk - connect using TLS and a pre-shared
key
cert - connect using TLS and a
certificate --tls-ca-file CA-file Full pathname of a file containing the top-level
CA(s) certificates for peer certificate
verification --tls-crl-file CRL-file Full pathname of a file containing revoked
certificates --tls-agent-cert-issuer cert-issuer Allowed agent certificate issuer --tls-agent-cert-subject cert-subject Allowed agent certificate subject --tls-cert-file cert-file Full pathname of a file containing the certificate
or certificate chain --tls-key-file key-file Full pathname of a file containing the private key --tls-psk-identity PSK-identity Unique, case sensitive string used to
identify the pre-shared key --tls-psk-file PSK-file Full pathname of a file containing the pre-shared
key Example(s):
zabbix_get -s 127.0.0.1 -p -k "system.cpu.load[all,avg1]" zabbix_get -s 127.0.0.1 -p -k "system.cpu.load[all,avg1]" \
--tls-connect cert --tls-ca-file /home/zabbix/zabbix_ca_file \
--tls-agent-cert-issuer \
"CN=Signing CA,OU=IT operations,O=Example Corp,DC=example,DC=com" \
--tls-agent-cert-subject \
"CN=server1,OU=IT operations,O=Example Corp,DC=example,DC=com" \
--tls-cert-file /home/zabbix/zabbix_get.crt \
--tls-key-file /home/zabbix/zabbix_get.key zabbix_get -s 127.0.0.1 -p -k "system.cpu.load[all,avg1]" \
--tls-connect psk --tls-psk-identity "PSK ID Zabbix agentd" \
--tls-psk-file /home/zabbix/zabbix_agentd.psk Report bugs to: <https://support.zabbix.com>
Zabbix home page: <http://www.zabbix.com>
Documentation: <https://www.zabbix.com/documentation>

当然出现这种错误还有可能是其他的原因,不断补充中。。

最新文章

  1. FMDB 数据库
  2. iPhone的CSS3媒体查询
  3. 对JS原型的一些理解
  4. volley_之基本使用
  5. 无限极分类sql数据库的设计
  6. Multiple reportviewers on one page With reportviwer 11.0
  7. 【图解ASP.NET MVC运行机制理解-简易版】
  8. 使用动态内置的JSON 数据源
  9. formData实现图片上传
  10. O2O网站
  11. tensorflow object detection api graph rewriter
  12. 洛谷P1030求先序排列
  13. Solidity通过合约转ERC20代币
  14. POJ1468 Sorting Slides
  15. web窗体的运用
  16. oc 代码块的使用
  17. iOS边练边学--UITableViewCell的常见属性设置
  18. DataGridView使用技巧二:设置单元格只读
  19. 在原有的基础之上,启用NAT模型
  20. java.lang.NoSuchFieldError: TRACE

热门文章

  1. Apache伪静态配置,支持.htaccess配置方法
  2. 阿里云被挖矿使用,导致cpu长期处于100%,ddgs进程,xWx3T进程,关于redis密码
  3. LED驱动程序分析
  4. [Converge] Backpropagation Algorithm
  5. Hash冲突的解决方法
  6. Java按钮控件数组实现计算器界面
  7. Fiddler 抓取 Genymotion 数据包
  8. VS2013 编译&amp;使用 stlport
  9. hbase shell 启动报错
  10. C++多线程编程简单实例