Notifications

9 views

Description

When I running discovery for HAProxy, the following error comes up in the Discovery Log: Cannot locate config file: /elastic_cloud_apps/haproxy/haproxy.global.cfg - Exit status: 1

Release or Environment

Any And all

Cause

The classification script for the HAProxy Process Classifier creates a variable called hp_cfg
The value of this variable it generally evaluates to:
" /opt/kibana/haproxy-2.1.2/etc/haproxy/haproxy.cfg"

In the process classifier it runs 2 triggered probes. One of them is HAProxy - Get Configuration:
https://<InstanceName>.service-now.com/discovery_probes.do?sys_id=86b5c2c1d7622100a866ee5b5e6103fe

This probe runs a shell script that is specified in the probe parameters called get-hacfg.sh
When it runs this probe it adds the argument for hp_cfg, essentially running
get-hacfg.sh hp_cfg
which technically translates to:
get-hacfg.sh /opt/kibana/haproxy-2.1.2/etc/haproxy/haproxy.cfg

When we look at that script, the very beginning runs this code block:
# if no path for haproxy.cfg then exit
if [ ! -f $CFG_LOCATION ]; then
echo "Cannot locate config file: $CFG_LOCATION"
exit 1
fi


Resolution

Check the permissions of the credential being used and make sure it can access the file /opt/kibana/haproxy-2.1.2/etc/haproxy/haproxy.cfg on the target host

Article Information

Last Updated:2020-09-25 14:49:39
Published:2020-09-25