-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Zabbix API HTTP Connection Error at /usr/lib/zabbix/externalscripts/k8s_collect.pl line 65 #1
Comments
Maybe zabbix is not running on local interface ?
Can u curl http://127..0.0.1/zabbix/ ?
Von: Ugo Viti [mailto:[email protected]]
Gesendet: Montag, 29. April 2019 23:05
An: objectiveit/zabbix-kubernetes <[email protected]>
Cc: Subscribed <[email protected]>
Betreff: [objectiveit/zabbix-kubernetes] Zabbix API HTTP Connection Error at /usr/lib/zabbix/externalscripts/k8s_collect.pl line 65 (#1)
Hi,
very nice project!
The k8s_discovery.pl works good, but I have a problem with k8s_collect.pl
I double checked the user and password API, but it doesn't works:
Zabbix API HTTP Connection Error at /usr/lib/zabbix/externalscripts/k8s_collect.pl line 65.
this URL is correct:
my $APIURL = 'http://127.0.0.1/zabbix/api_jsonrpc.php';
and logging in the gui with the specified APIUSER and APIPASS works without problems (the specified user is Super Admin with read/write access to all Zabbix hostgroups).
How can I debug the Zabbix API HTTP Connection Error?
I'm using Zabbix 4.2.1
Kind regards
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#1>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ABP63MVMVJ7VED62NWWOF5TPS5PIHANCNFSM4HJGX2SQ>.
|
Hi, thank you for the reply. Yes, Zabbix web server is listening on local loopback:
same result using http://localhost/zabbix/ running by hand I got the following error:
zabbix-kubernetes is compatible with Zabbix 4.2? Thank you for the help, keep up the good work. Kind regards |
Collect script is configured inside. Also default agent port ... ZABBIX_PORT = '10051';
It uses not api.... it sends to agent.
Von unterwegs gesendet.
Am 03.05.2019 um 17:29 schrieb Ugo Viti <[email protected]<mailto:[email protected]>>:
Hi,
thank you for the reply.
Yes, Zabbix web server is listening on local loopback:
[zabbix@mon01 ~]$ curl http://127.0.0.1/zabbix/
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="Author" content="Zabbix SIA" />
<title>izMon: Zabbix</title>
<link rel="icon" href="favicon.ico">
same result using http://localhost/zabbix/
running by hand I got the following error:
[zabbix@mon01 ~]$ /usr/lib/zabbix/externalscripts/k8s_collect.pl 127.0.0.1 /var/lib/zabbix/.kube/config test
Zabbix API HTTP Connection Error at /usr/lib/zabbix/externalscripts/k8s_collect.pl line 65.
[root@mon01 ~]# netstat -atpun | grep zabbix
tcp 0 0 0.0.0.0:10050 0.0.0.0:* LISTEN 17605/zabbix_agentd
tcp 0 0 0.0.0.0:10051 0.0.0.0:* LISTEN 17690/zabbix_server
tcp6 0 0 :::10050 :::* LISTEN 17605/zabbix_agentd
tcp6 0 0 :::10051 :::* LISTEN 17690/zabbix_server
zabbix-kubernetes is compatible with Zabbix 4.2?
Can I look into or debug other options? How can I debug the API accesso from python?
Thank you for the help, keep up the good work.
Kind regards
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#1 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ABP63MWLQBKEBZCS5PI4GWLPTRK37ANCNFSM4HJGX2SQ>.
|
I am experiencing the same issue. I am running 4.0 |
We are running zabbix 4.0.7 and changed only api user and password in that script.
Discovery is working ?
Api user has admin role in zabix.
Can u print out json result of request ?
Von: Mogie Pete <[email protected]>
Gesendet: Freitag, 3. Mai 2019 20:55
An: objectiveit/zabbix-kubernetes <[email protected]>
Cc: André Frintrop <[email protected]>; Mention <[email protected]>
Betreff: Re: [objectiveit/zabbix-kubernetes] Zabbix API HTTP Connection Error at /usr/lib/zabbix/externalscripts/k8s_collect.pl line 65 (#1)
@Frintrop<https://github.com/Frintrop>
I am experiencing the same issue. I am running 4.0
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#1 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ABP63MU2Y3WUSVNOYGOPFGDPTSC7JANCNFSM4HJGX2SQ>.
|
Discovery is working. Using the code provided by Zabbix I am able to authenticate with the account created to monitor k8s so the account is working and the server is taking connections.
And here is the code if I try to log in using curl.
|
Hi All, Please pay attention that discovery do not use Zabbix API, so there is no "dependency" between "discovery works" and "collector doesnt work". Your issue with API connection most probbaly related to Zabbix API User. If username and password is correct and URL "localhost" is accessible from script(that means you run script from zabbix WEB server) - THEN YOU NEED TO CHECK THE FOLLOWING:
ADMIN permissions required for reading item's keys. Maxim |
Hi, I double checked the user password and privileges (testing as Super Admin right now). And tested with script auth.pl of @MogiePete and it's works good using the same url user and password of k8s_collect.pl:
I'm running it into a CentOS 7 system with official perl modules installed.
What perl version are you using? Kind regards |
Please try to add response printing adter line 59 with: Its very rare case when perl libs versions are root cause, also I dont remember versions I checked. If you have successfully logged in with custom API script, all you need to troubleshoot is to find HTTP request differences between you custom script and script in this repo. Any HTTP proxy you have exp with will help. |
Thankyou, made the change, now I got:
|
please check again, I've edited comment in few secodns, you read too fast :D |
I have it dump the $respAuth and the content and this is the results:
|
you have HTTP response code 412, no idea why. I recommend to use HTTP proxy or tcpdump to verify difference between 2 HTTP requests. |
got the same thing - zabbix 4.0.x on centos 7, anybody was able to fix it ? |
so I guess what helped me with the authentification error is that in collect script in config section the IPs/hosts needed to be the same after that the script can connect to the API see IP in $APIURL and $ZABBIXSERVER CONFIGmy $APIURL = 'http://10.0.2.15/zabbix/api_jsonrpc.php'; the thing is now that the data are not comming to zabbix only if I run it by hand than some data comes in to it ( can anybody repeat this ? ) from the zabbix log ( no data sent ) in lastest data still zabbix api connection error 18969:20190812:091944.651 End of substitute_key_macros():SUCCEED data:'k8s_collect.pl[10.0.2.15,/root/.minikube/config/config.json,kube-system]' but if I run this command by hand I get at least some data in the console ( works if run as root ) [root@centos7 externalscripts]# /usr/lib/zabbix/externalscripts/k8s_collect.pl '10.0.2.15' '/root/.minikube/config/config.json' 'kube-system' |
It worked for me after using JSON :: RPC :: Legacy :: Client for both authentication |
hi @ninjageek-zcs ,can you upload your k8s_collect.pl file after modifying the JSON :: RPC :: Legacy :: Client |
hello @MogiePete , I have the same problem as you, I run auth.pl and it works for me but k8s_collect.pl still fails me with "Zabbix API HTTP Connection Error at ./k8s_collect.pl line 66.", did you get to solve it? |
$ua-> default_header('Content-Type' => 'application/json-rpc'); and in each POST |
Hi,
very nice project!
The k8s_discovery.pl works good, but I have a problem with k8s_collect.pl
I double checked the user and password API, but it doesn't works:
Zabbix API HTTP Connection Error at /usr/lib/zabbix/externalscripts/k8s_collect.pl line 65.
this URL is correct:
my $APIURL = 'http://127.0.0.1/zabbix/api_jsonrpc.php';
and logging in the gui with the specified APIUSER and APIPASS works without problems (the specified user is Super Admin with read/write access to all Zabbix hostgroups).
How can I debug the Zabbix API HTTP Connection Error?
I'm using Zabbix 4.2.1
Kind regards
The text was updated successfully, but these errors were encountered: