thenodon / go-infoblox-exporter

GNU General Public License v3.0
0 stars 0 forks source link

Failed to get nodenot found #1

Closed pbousek closed 10 months ago

pbousek commented 10 months ago

Describe the bug Doesn't get any metric - probe_success:0

To Reproduce Steps to reproduce the behavior: curl -s 'http://localhost:9597/probe?target=ip-of-GM&module=member_services'

Expected behavior I created user on infoblox with RO rights and allow access to api, add this user to config file. I can see in log that user is connected to infoblox node. In syslog on server where infoblox-exporter is running shows following: Nov 24 14:38:40 smbnmcacti infoblox_exporter[2526639]: {"level":"error","msg":"Failed to get nodenot found","time":"2023-11-24T14:38:40+01:00"} Nov 24 14:38:40 smbnmcacti infoblox_exporter[2526639]: {"exec_time":5456918,"length":0,"level":"info","method":"GET","msg":"api call","requestId":"2YcmCV0cDeepCVEb9ufhYwHH2eU","status":0,"time":"2023-11-24T14: 38:40+01:00","uri":"/probe?target=10.217.112.61\u0026module=member_services"}

Logged message isn't very helpful for troubleshooting. Do you have any idea what could be wrong? I set the same IP that I use with curl into config file.

Environment (please complete the following information):

pbousek commented 10 months ago

It seems that I can connect & authenticate and logout. But there is not mentioned any other issue in audit log. 2023-11-27 09:50:01.485Z [monitoring]: Logout - - ip=10.216.3.202 group=RO-monitoring trigger_event=WAPI\040Logout\040-\040returning\040an\040invalid\040cookie

2023-11-27 09:50:01.418Z [monitoring]: Login_Allowed - - to=AdminConnector ip=10.216.3.202 auth=LOCAL group=RO-monitoring apparently_via=API

pbousek commented 10 months ago

Resolved, sorry for the issue - I used IP addresses in curl and config and it seems I need to use member names instead.

thenodon commented 10 months ago

Hi @pbousek In the environments I have used the exporter I have connected to a master infoblox node. Im not a Infoblox expert but as I understand it the I refer to in the README.md master is the Grid Master. In a HA setup I think you can also use the Master Candidate. If its unclear in the README.md please let me know or do a PR to improve documentation. As I said I'm not a Infoblox expert in anyway.

pbousek commented 10 months ago

Hi, in Grid (multiple infoblox appliances managed from single management - Grid Master) you will always have Grid Master - it contains data (DNS, DHCP ... ) for all nodes in whole grid and you may have Grid Master Candidate - it has replica of all GM data and in case of disaster GM you can manually promote GMC to GM. GUI (and probably WAPI too) will always run only on GM, so I think you can connect only to GM. HA is something else - every node (GM, GMC, or node that run only dns, dhcp, etc. services) can be in HA node - it consists of two appliances in active/standby mode with one virtual IP above those two nodes - I hope that I explain little bit Infoblox terminology.

My issue above was only caused by use IP address in node name in curl query instead of menber name (host name). Probably IP cannot be used to query member data.

Thank you.

thenodon commented 10 months ago

Yes the target in the url is a member, but I would guess both ip or fqdn of the member can be used, if module is member or a dhcp zone if module is dhcp_utilization. I always use https://github.com/thenodon/infoblox_discovery to discovery the targets related to what the master manage. I think the documentation can be improved so separate between the exporter configuration and how to query the exporter.