Skip to content
This repository has been archived by the owner on May 3, 2023. It is now read-only.

Installation brokes OC path #18

Open
prometherion opened this issue May 11, 2018 · 1 comment
Open

Installation brokes OC path #18

prometherion opened this issue May 11, 2018 · 1 comment

Comments

@prometherion
Copy link

Trying to install using make install:

[root@HIDDEN nagios-plugins-openshift]# make install
mkdir -p /usr/lib/nagios-plugins-openshift
cp new-app-and-wait "/usr/lib/nagios-plugins-openshift/new-app-and-wait"
sed -r \
	-e 's#\b(OPENSHIFT_CLIENT_BINARY=)/usr/bin/oc\b#\1usr/lib/openshift-origin-client-tools/oc#' \
	< utils \
	> "/usr/lib/nagios-plugins-openshift/utils"
sed -r \
	-e 's#(^\. )/usr/lib(/nagios-plugins-openshift/utils)$#\1usr/lib\2#g' \
	< write-config \
	> "/usr/lib/nagios-plugins-openshift/write-config"
chmod +x /usr/lib/nagios-plugins-openshift/{utils,write-config,new-app-and-wait}
mkdir -p /usr/lib/nagios/plugins
set -e && for i in check_*; do \
	echo "Patching $i ..." >&2 && \
	sed -re 's#(^\. )/usr/lib(/nagios-plugins-openshift/utils)$#\1usr/lib\2#g' \
		< "$i" \
		> "/usr/lib/nagios/plugins/$(basename "$i")"; \
done
Patching check_hawkular_machine_timestamp ...
Patching check_openshift_cert_expiry_report ...
Patching check_openshift_endtoend_result ...
Patching check_openshift_es_stats ...
Patching check_openshift_node ...
Patching check_openshift_node_fluentd ...
Patching check_openshift_node_list ...
Patching check_openshift_node_resources ...
Patching check_openshift_pod_count ...
Patching check_openshift_pod_cpu_usage ...
Patching check_openshift_pod_memory ...
Patching check_openshift_pod_node_alloc ...
Patching check_openshift_pod_status_count ...
Patching check_openshift_project_phase ...
Patching check_openshift_project_pod_phase ...
Patching check_openshift_pv_avail ...
Patching check_openshift_pvc_phase ...
chmod +x /usr/lib/nagios/plugins/check_*
mkdir -p /usr/share/icinga2/include/plugins-contrib.d
cp -v openshift*.conf /usr/share/icinga2/include/plugins-contrib.d
'openshift.conf' -> '/usr/share/icinga2/include/plugins-contrib.d/openshift.conf'
'openshift-dns.conf' -> '/usr/share/icinga2/include/plugins-contrib.d/openshift-dns.conf'

But executions fails:

[root@HIDDEN nagios-plugins-openshift]# /usr/lib/nagios/plugins/check_openshift_node -f /path/to/kubeconfig -n ocp-node-01.domain.tld
/usr/lib/nagios/plugins/check_openshift_node: line 5: usr/lib/nagios-plugins-openshift/utils: No such file or directory
@rahoa
Copy link

rahoa commented Jul 10, 2018

Dirty fix.

In Makefile :

10c10
< 		-e 's#\b(OPENSHIFT_CLIENT_BINARY=)/usr/bin/oc\b#\1$(LIBDIR)/openshift-origin-client-tools/oc#' \
---
> 		-e 's#\b(OPENSHIFT_CLIENT_BINARY=)/usr/bin/oc\b#\1/$(LIBDIR)/openshift-origin-client-tools/oc#' \
14c14
< 		-e 's#(^\. )/usr/lib(/nagios-plugins-openshift/utils)$$#\1$(LIBDIR)\2#g' \
---
> 		-e 's#(^\. )/usr/lib(/nagios-plugins-openshift/utils)$$#\1/$(LIBDIR)\2#g' \
21c21
< 		sed -re 's#(^\. )/usr/lib(/nagios-plugins-openshift/utils)$$#\1$(LIBDIR)\2#g' \
---
> 		sed -re 's#(^\. )/usr/lib(/nagios-plugins-openshift/utils)$$#\1/$(LIBDIR)\2#g' \

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants