{"id":93361,"date":"2024-04-24T15:09:10","date_gmt":"2024-04-24T07:09:10","guid":{"rendered":"http:\/\/gulass.cn\/?p=93361"},"modified":"2024-04-24T15:09:10","modified_gmt":"2024-04-24T07:09:10","slug":"zabbix-port","status":"publish","type":"post","link":"https:\/\/gulass.cn\/zabbix-port.html","title":{"rendered":"\u4f7f\u7528Zabbix\u5b9e\u73b0\u6279\u91cf\u76d1\u63a7\u7aef\u53e3\u72b6\u6001"},"content":{"rendered":"
\u5bfc\u8bfb<\/td>\n | \u3000\u5728\u76d1\u63a7\u751f\u4ea7\u73af\u5883\u7684\u670d\u52a1\u7684\u65f6\u5019\uff0c\u901a\u5e38\u9700\u8981\u5bf9\u591a\u4e2a\u7aef\u53e3\u8fdb\u884c\u76d1\u63a7\uff0c\u5982\u679c\u6211\u4eec\u624b\u52a8\u4e00\u4e2a\u4e00\u4e2a\u7684\u6dfb\u52a0\uff0c\u8fd9\u5c06\u662f\u4e00\u4ef6\u5f88\u9ebb\u70e6\u7684\u4e8b\u60c5\uff0c\u4e3a\u4e86\u51cf\u5c11\u8fd9\u6837\u7684\u60c5\u51b5\uff0c\u6211\u4eec\u91c7\u7528\u6279\u91cf\u6dfb\u52a0\u76d1\u63a7\u7aef\u53e3\u7684\u65b9\u6cd5\uff0c\u8fd9\u662f\u975e\u5e38\u5e38\u89c1\u7684\u9700\u6c42\uff0czabbix\u4e5f\u662f\u652f\u6301\u8fd9\u79cd\u65b9\u5f0f\u7684\uff0c\u9700\u8981\u4f7f\u7528zabbix\u7684Discovery\u529f\u80fd\u6765\u5b9e\u73b0\uff0c\u4e0b\u9762\u5c0f\u7f16\u5c31\u7ed9\u5927\u5bb6\u5206\u4eab\u4e00\u4e0b\u6279\u91cf\u6dfb\u52a0\u5bf9\u53e3\u7684\u5360\u7528\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n \u4f7f\u7528Zabbix\u76d1\u63a7\u5982\u4f55\u76d1\u63a7\u670d\u52a1\u5668\u7aef\u53e3\u72b6\u6001\uff0c\u5927\u6982\u7684\u6d41\u7a0b\uff1azabbix\u76d1\u63a7\u670d\u52a1\u81ea\u5e26\u7aef\u53e3\u76d1\u63a7\u7684\u76d1\u63a7\u9879\uff0c\u6240\u4ee5\u9700\u8981\u6211\u4eec\u81ea\u5df1\u624b\u52a8\u5b9a\u4e49\u6240\u76d1\u63a7\u7684item\uff0c\u5ba2\u6237\u7aef\u83b7\u53d6\u7684\u7aef\u53e3\u5217\u8868\u901a\u8fc7agent\u4f20\u9001\u5230\u670d\u52a1\u7aef\uff0c<\/p>\n \u53ea\u9700\u5728\u670d\u52a1\u7aef\u8fdb\u884c\u7aef\u53e3\u76d1\u63a7\u6a21\u677f\u914d\u7f6e\uff0c\u7136\u540e\u81ea\u5b9a\u4e49\u76d1\u63a7\u56fe\u5f62\uff0c\u6dfb\u52a0\u76d1\u63a7\u9879\u5373\u53ef\uff01<\/p>\n \u4e0b\u9762\u5c31\u6765\u7ed9\u5927\u5bb6\u5206\u4eab\u4e00\u4e0b\u6279\u91cf\u6dfb\u52a0\u7aef\u53e3\u7684\u65b9\u6cd5\uff01<\/p>\n \u7b2c\u4e00\uff1a\u81ea\u52a8\u626b\u63cf\u7aef\u53e3\u5e76\u76d1\u63a7\u62a5\u8b66<\/strong><\/div>\n 1.\u7f16\u5199\u811a\u672c\u626b\u63cf\u7aef\u53e3<\/strong><\/span><\/div>\n
\u5c06\u811a\u672c\u653e\u5728\u5ba2\u6237\u7aef \/usr\/lib\/zabbix\/alertscripts \u8def\u5f84\u4e0b\u9762<\/p>\n 2.\u4fee\u6539\u88ab\u76d1\u63a7\u7aef\u7684zabbix_agent.conf\u914d\u7f6e\u6587\u4ef6<\/strong><\/span><\/div>\n UnsafeUserParameters=1<\/p>\n UserParameter=tcpportlisten,\/usr\/lib\/zabbix\/alertscripts\/check_port.sh<\/p>\n \u91cd\u542f\u5ba2\u6237\u7aef\u670d\u52a1<\/p>\n 3.\u670d\u52a1\u7aef\u6d4b\u8bd5<\/strong><\/span><\/div>\n \u6267\u884c\u547d\u4ee4\uff1azabbix_get -s 192.168.92.9 -p 10050 -k tcpportlisten<\/p>\n
\u7b2c\u4e8c\uff1a\u9875\u9762\u914d\u7f6e<\/strong><\/div>\n 1.\u6dfb\u52a0\u6a21\u677f<\/strong><\/span><\/div>\n <\/p>\n 2.\u6dfb\u52a0\u81ea\u52a8\u53d1\u73b0\u89c4\u5219<\/strong><\/span><\/div>\n \u65b0\u521b\u5efa\u7684\u6a21\u677f\u4e2d\u70b9\u51fb-->\u81ea\u52a8\u53d1\u73b0\u89c4\u5219-->\u7136\u540e\u9009\u62e9\u521b\u5efa\u53d1\u73b0\u89c4\u5219<\/p>\n
3.\u521b\u5efa\u76d1\u63a7\u9879\u539f\u578b<\/strong><\/span><\/div>\n
4.\u521b\u5efa\u89e6\u53d1\u5668\u7c7b\u578b<\/strong><\/span><\/div>\n <\/p>\n \u7b2c\u4e09\uff1a\u6279\u91cf\u6dfb\u52a0\u6307\u5b9a\u7aef\u53e3<\/strong><\/div>\n \u6709\u65f6\u5019\u6211\u4eec\u4e0d\u9700\u8981\u76d1\u63a7\u81ea\u52a8\u626b\u63cf\u51fa\u6765\u7684\u6240\u6709\u7684\u7aef\u53e3\uff0c\u8fd9\u4e9b\u7aef\u53e3\u9700\u8981\u6211\u4eec\u6307\u5b9a\uff0c\u8fd9\u4e2a\u9700\u6c42\u4e5f\u662f\u6bd4\u8f83\u5e38\u89c1\u7684\uff0c\u6709\u4e86\u4e0a\u9762\u7684\u57fa\u7840\uff0c\u5b9e\u73b0\u8fd9\u4e2a\u4e1c\u897f\u5176\u5b9e\u662f\u6bd4\u8f83\u7b80\u5355\uff0c\u5176\u5b9e\u4ed4\u7ec6\u770b\u770b\u811a\u672c\u5c31\u80fd\u5b9e\u73b0\u3002<\/p>\n \u8981\u5b9e\u73b0\u8fd9\u4e2a\u529f\u80fd\u6211\u4eec\u53ea\u9700\u8981\uff0c\u5c06\u811a\u672c\u66ff\u6362\u6210\u4e0b\u9762\u5185\u5bb9\u5373\u53ef\uff1a<\/p>\n <\/p>\n \u6211\u4eec\u53ea\u9700\u8981\u5728port_list\u4e2d\u6dfb\u52a0\u60f3\u8981\u76d1\u63a7\u7684\u7aef\u53e3\u53f7\u5373\u53ef\uff01\u6ce8\u610f\u683c\u5f0f\uff0c\u4ee5\u9017\u53f7\u9694\u5f00\uff01<\/p>\n \n |