Skip to content

Commit

Permalink
Merge pull request #214 from newrelic/missingInfraAgentMessage
Browse files Browse the repository at this point in the history
chore: update systemctl check and error message
  • Loading branch information
Julien4218 authored Feb 24, 2021
2 parents 3290f5c + 518671b commit a089678
Show file tree
Hide file tree
Showing 37 changed files with 37 additions and 185 deletions.
6 changes: 1 addition & 5 deletions recipes/newrelic/infrastructure/logs/docker-logs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,7 @@ install:
assert_pre_req:
cmds:
- |
sudo systemctl is-active --quiet newrelic-infra
if [ $? -ne 0 ]; then
echo "The newrelic-infra agent service is not installed on the host, but is required to install this integration." >> /dev/stderr
exit 1
fi
sudo systemctl is-active --quiet newrelic-infra || (echo "The infrastructure agent is required to install this integration, we recommend going through our guided install path for this pre-requisite which can be found here: https://docs.newrelic.com/docs/new-relic-guided-installation-overview" >> /dev/stderr; exit 1)
setup:
cmds:
Expand Down
6 changes: 1 addition & 5 deletions recipes/newrelic/infrastructure/logs/logs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,7 @@ install:
assert_pre_req:
cmds:
- |
sudo systemctl is-active --quiet newrelic-infra
if [ $? -ne 0 ]; then
echo "The newrelic-infra agent service is not installed on the host, but is required to install this integration." >> /dev/stderr
exit 1
fi
sudo systemctl is-active --quiet newrelic-infra || (echo "The infrastructure agent is required to install this integration, we recommend going through our guided install path for this pre-requisite which can be found here: https://docs.newrelic.com/docs/new-relic-guided-installation-overview" >> /dev/stderr; exit 1)
setup:
cmds:
Expand Down
6 changes: 1 addition & 5 deletions recipes/newrelic/infrastructure/ohi/apache/debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,7 @@ install:
assert_pre_req:
cmds:
- |
sudo systemctl is-active --quiet newrelic-infra
if [ $? -ne 0 ]; then
echo "The newrelic-infra agent service is not installed on the host, but is required to install this integration." >> /dev/stderr
exit 1
fi
sudo systemctl is-active --quiet newrelic-infra || (echo "The infrastructure agent is required to install this integration, we recommend going through our guided install path for this pre-requisite which can be found here: https://docs.newrelic.com/docs/new-relic-guided-installation-overview" >> /dev/stderr; exit 1)
- |
STUB_STATUS_ENABLED=$(curl {{.NR_CLI_STATUS_URL}} -s | grep "IdleWorkers:" | wc -l)
if [ $STUB_STATUS_ENABLED -eq 0 ] ; then
Expand Down
6 changes: 1 addition & 5 deletions recipes/newrelic/infrastructure/ohi/apache/rhel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,7 @@ install:
assert_pre_req:
cmds:
- |
sudo systemctl is-active --quiet newrelic-infra
if [ $? -ne 0 ]; then
echo "The newrelic-infra agent service is not installed on the host, but is required to install this integration." >> /dev/stderr
exit 1
fi
sudo systemctl is-active --quiet newrelic-infra || (echo "The infrastructure agent is required to install this integration, we recommend going through our guided install path for this pre-requisite which can be found here: https://docs.newrelic.com/docs/new-relic-guided-installation-overview" >> /dev/stderr; exit 1)
- |
STUB_STATUS_ENABLED=$(curl {{.NR_CLI_STATUS_URL}} -s | grep "IdleWorkers:" | wc -l)
if [ $STUB_STATUS_ENABLED -eq 0 ] ; then
Expand Down
6 changes: 1 addition & 5 deletions recipes/newrelic/infrastructure/ohi/cassandra/debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,7 @@ install:
assert_pre_req:
cmds:
- |
sudo systemctl is-active --quiet newrelic-infra
if [ $? -ne 0 ]; then
echo "The newrelic-infra agent service is not installed on the host, but is required to install this integration." >> /dev/stderr
exit 1
fi
sudo systemctl is-active --quiet newrelic-infra || (echo "The infrastructure agent is required to install this integration, we recommend going through our guided install path for this pre-requisite which can be found here: https://docs.newrelic.com/docs/new-relic-guided-installation-overview" >> /dev/stderr; exit 1)
setup:
label: "Installing Cassandra integration..."
Expand Down
6 changes: 1 addition & 5 deletions recipes/newrelic/infrastructure/ohi/cassandra/rhel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,7 @@ install:
assert_pre_req:
cmds:
- |
sudo systemctl is-active --quiet newrelic-infra
if [ $? -ne 0 ]; then
echo "The newrelic-infra agent service is not installed on the host, but is required to install this integration." >> /dev/stderr
exit 1
fi
sudo systemctl is-active --quiet newrelic-infra || (echo "The infrastructure agent is required to install this integration, we recommend going through our guided install path for this pre-requisite which can be found here: https://docs.newrelic.com/docs/new-relic-guided-installation-overview" >> /dev/stderr; exit 1)
setup:
label: "Installing Cassandra integration..."
Expand Down
6 changes: 1 addition & 5 deletions recipes/newrelic/infrastructure/ohi/consul/debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,7 @@ install:
assert_pre_req:
cmds:
- |
sudo systemctl is-active --quiet newrelic-infra
if [ $? -ne 0 ]; then
echo "The newrelic-infra agent service is not installed on the host, but is required to install this integration." >> /dev/stderr
exit 1
fi
sudo systemctl is-active --quiet newrelic-infra || (echo "The infrastructure agent is required to install this integration, we recommend going through our guided install path for this pre-requisite which can be found here: https://docs.newrelic.com/docs/new-relic-guided-installation-overview" >> /dev/stderr; exit 1)
setup:
label: "Installing HashiCorp Consul integration..."
Expand Down
6 changes: 1 addition & 5 deletions recipes/newrelic/infrastructure/ohi/consul/rhel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,7 @@ install:
assert_pre_req:
cmds:
- |
sudo systemctl is-active --quiet newrelic-infra
if [ $? -ne 0 ]; then
echo "The newrelic-infra agent service is not installed on the host, but is required to install this integration." >> /dev/stderr
exit 1
fi
sudo systemctl is-active --quiet newrelic-infra || (echo "The infrastructure agent is required to install this integration, we recommend going through our guided install path for this pre-requisite which can be found here: https://docs.newrelic.com/docs/new-relic-guided-installation-overview" >> /dev/stderr; exit 1)
setup:
label: "Installing HashiCorp Consul integration..."
Expand Down
6 changes: 1 addition & 5 deletions recipes/newrelic/infrastructure/ohi/couchbase/debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,7 @@ install:
assert_pre_req:
cmds:
- |
sudo systemctl is-active --quiet newrelic-infra
if [ $? -ne 0 ]; then
echo "The newrelic-infra agent service is not installed on the host, but is required to install this integration." >> /dev/stderr
exit 1
fi
sudo systemctl is-active --quiet newrelic-infra || (echo "The infrastructure agent is required to install this integration, we recommend going through our guided install path for this pre-requisite which can be found here: https://docs.newrelic.com/docs/new-relic-guided-installation-overview" >> /dev/stderr; exit 1)
setup:
label: "Installing Couchbase integration..."
cmds:
Expand Down
6 changes: 1 addition & 5 deletions recipes/newrelic/infrastructure/ohi/couchbase/rhel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,7 @@ install:
assert_pre_req:
cmds:
- |
sudo systemctl is-active --quiet newrelic-infra
if [ $? -ne 0 ]; then
echo "The newrelic-infra agent service is not installed on the host, but is required to install this integration." >> /dev/stderr
exit 1
fi
sudo systemctl is-active --quiet newrelic-infra || (echo "The infrastructure agent is required to install this integration, we recommend going through our guided install path for this pre-requisite which can be found here: https://docs.newrelic.com/docs/new-relic-guided-installation-overview" >> /dev/stderr; exit 1)
setup:
label: "Installing Couchbase integration..."
Expand Down
6 changes: 1 addition & 5 deletions recipes/newrelic/infrastructure/ohi/elasticsearch/debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,7 @@ install:
assert_pre_req:
cmds:
- |
sudo systemctl is-active --quiet newrelic-infra
if [ $? -ne 0 ]; then
echo "The newrelic-infra agent service is not installed on the host, but is required to install this integration." >> /dev/stderr
exit 1
fi
sudo systemctl is-active --quiet newrelic-infra || (echo "The infrastructure agent is required to install this integration, we recommend going through our guided install path for this pre-requisite which can be found here: https://docs.newrelic.com/docs/new-relic-guided-installation-overview" >> /dev/stderr; exit 1)
setup:
label: "Installing Elasticsearch integration..."
Expand Down
6 changes: 1 addition & 5 deletions recipes/newrelic/infrastructure/ohi/elasticsearch/rhel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,7 @@ install:
assert_pre_req:
cmds:
- |
sudo systemctl is-active --quiet newrelic-infra
if [ $? -ne 0 ]; then
echo "The newrelic-infra agent service is not installed on the host, but is required to install this integration." >> /dev/stderr
exit 1
fi
sudo systemctl is-active --quiet newrelic-infra || (echo "The infrastructure agent is required to install this integration, we recommend going through our guided install path for this pre-requisite which can be found here: https://docs.newrelic.com/docs/new-relic-guided-installation-overview" >> /dev/stderr; exit 1)
setup:
label: "Installing Elasticsearch integration..."
Expand Down
6 changes: 1 addition & 5 deletions recipes/newrelic/infrastructure/ohi/elasticsearch/suse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,7 @@ install:
assert_pre_req:
cmds:
- |
sudo systemctl is-active --quiet newrelic-infra
if [ $? -ne 0 ]; then
echo "The newrelic-infra agent service is not installed on the host, but is required to install this integration." >> /dev/stderr
exit 1
fi
sudo systemctl is-active --quiet newrelic-infra || (echo "The infrastructure agent is required to install this integration, we recommend going through our guided install path for this pre-requisite which can be found here: https://docs.newrelic.com/docs/new-relic-guided-installation-overview" >> /dev/stderr; exit 1)
setup:
label: "Installing Elasticsearch integration..."
Expand Down
6 changes: 1 addition & 5 deletions recipes/newrelic/infrastructure/ohi/haproxy/debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,7 @@ install:
assert_pre_req:
cmds:
- |
sudo systemctl is-active --quiet newrelic-infra
if [ $? -ne 0 ]; then
echo "The newrelic-infra agent service is not installed on the host, but is required to install this integration." >> /dev/stderr
exit 1
fi
sudo systemctl is-active --quiet newrelic-infra || (echo "The infrastructure agent is required to install this integration, we recommend going through our guided install path for this pre-requisite which can be found here: https://docs.newrelic.com/docs/new-relic-guided-installation-overview" >> /dev/stderr; exit 1)
setup:
label: "Installing HAProxy integration..."
Expand Down
6 changes: 1 addition & 5 deletions recipes/newrelic/infrastructure/ohi/haproxy/rhel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,7 @@ install:
assert_pre_req:
cmds:
- |
sudo systemctl is-active --quiet newrelic-infra
if [ $? -ne 0 ]; then
echo "The newrelic-infra agent service is not installed on the host, but is required to install this integration." >> /dev/stderr
exit 1
fi
sudo systemctl is-active --quiet newrelic-infra || (echo "The infrastructure agent is required to install this integration, we recommend going through our guided install path for this pre-requisite which can be found here: https://docs.newrelic.com/docs/new-relic-guided-installation-overview" >> /dev/stderr; exit 1)
setup:
label: "Installing HAProxy integration..."
Expand Down
6 changes: 1 addition & 5 deletions recipes/newrelic/infrastructure/ohi/jmx/debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,7 @@ install:
assert_pre_req:
cmds:
- |
sudo systemctl is-active --quiet newrelic-infra
if [ $? -ne 0 ]; then
echo "The newrelic-infra agent service is not installed on the host, but is required to install this integration." >> /dev/stderr
exit 1
fi
sudo systemctl is-active --quiet newrelic-infra || (echo "The infrastructure agent is required to install this integration, we recommend going through our guided install path for this pre-requisite which can be found here: https://docs.newrelic.com/docs/new-relic-guided-installation-overview" >> /dev/stderr; exit 1)
setup:
label: "Installing JMX integration..."
Expand Down
6 changes: 1 addition & 5 deletions recipes/newrelic/infrastructure/ohi/jmx/rhel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,7 @@ install:
assert_pre_req:
cmds:
- |
sudo systemctl is-active --quiet newrelic-infra
if [ $? -ne 0 ]; then
echo "The newrelic-infra agent service is not installed on the host, but is required to install this integration." >> /dev/stderr
exit 1
fi
sudo systemctl is-active --quiet newrelic-infra || (echo "The infrastructure agent is required to install this integration, we recommend going through our guided install path for this pre-requisite which can be found here: https://docs.newrelic.com/docs/new-relic-guided-installation-overview" >> /dev/stderr; exit 1)
setup:
label: "Installing JMX integration..."
Expand Down
6 changes: 1 addition & 5 deletions recipes/newrelic/infrastructure/ohi/memcached/debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,7 @@ install:
assert_pre_req:
cmds:
- |
sudo systemctl is-active --quiet newrelic-infra
if [ $? -ne 0 ]; then
echo "The newrelic-infra agent service is not installed on the host, but is required to install this integration." >> /dev/stderr
exit 1
fi
sudo systemctl is-active --quiet newrelic-infra || (echo "The infrastructure agent is required to install this integration, we recommend going through our guided install path for this pre-requisite which can be found here: https://docs.newrelic.com/docs/new-relic-guided-installation-overview" >> /dev/stderr; exit 1)
setup:
label: "Installing Memcached integration..."
Expand Down
6 changes: 1 addition & 5 deletions recipes/newrelic/infrastructure/ohi/memcached/rhel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,7 @@ install:
assert_pre_req:
cmds:
- |
sudo systemctl is-active --quiet newrelic-infra
if [ $? -ne 0 ]; then
echo "The newrelic-infra agent service is not installed on the host, but is required to install this integration." >> /dev/stderr
exit 1
fi
sudo systemctl is-active --quiet newrelic-infra || (echo "The infrastructure agent is required to install this integration, we recommend going through our guided install path for this pre-requisite which can be found here: https://docs.newrelic.com/docs/new-relic-guided-installation-overview" >> /dev/stderr; exit 1)
setup:
label: "Installing Memcached integration..."
Expand Down
6 changes: 1 addition & 5 deletions recipes/newrelic/infrastructure/ohi/mongodb/debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,7 @@ install:
assert_pre_req:
cmds:
- |
sudo systemctl is-active --quiet newrelic-infra
if [ $? -ne 0 ]; then
echo "The newrelic-infra agent service is not installed on the host, but is required to install this integration." >> /dev/stderr
exit 1
fi
sudo systemctl is-active --quiet newrelic-infra || (echo "The infrastructure agent is required to install this integration, we recommend going through our guided install path for this pre-requisite which can be found here: https://docs.newrelic.com/docs/new-relic-guided-installation-overview" >> /dev/stderr; exit 1)
- |
MONGODB_EXISTS=$(mongo --eval 'db.runCommand({ connectionStatus: 1 })' | grep "ok" | awk '{print $1 $2 $3}')
if [ $MONGODB_EXISTS != "ok:1"]; then
Expand Down
6 changes: 1 addition & 5 deletions recipes/newrelic/infrastructure/ohi/mongodb/rhel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,7 @@ install:
assert_pre_req:
cmds:
- |
sudo systemctl is-active --quiet newrelic-infra
if [ $? -ne 0 ]; then
echo "The newrelic-infra agent service is not installed on the host, but is required to install this integration." >> /dev/stderr
exit 1
fi
sudo systemctl is-active --quiet newrelic-infra || (echo "The infrastructure agent is required to install this integration, we recommend going through our guided install path for this pre-requisite which can be found here: https://docs.newrelic.com/docs/new-relic-guided-installation-overview" >> /dev/stderr; exit 1)
- |
MONGODB_EXISTS=$(mongo --eval 'db.runCommand({ connectionStatus: 1 })' | grep "ok" | awk '{print $1 $2 $3}')
if [ $MONGODB_EXISTS != "ok:1"]; then
Expand Down
6 changes: 1 addition & 5 deletions recipes/newrelic/infrastructure/ohi/mysql/debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,7 @@ install:
assert_pre_req:
cmds:
- |
sudo systemctl is-active --quiet newrelic-infra
if [ $? -ne 0 ]; then
echo "The newrelic-infra agent service is not installed on the host, but is required to install this integration." >> /dev/stderr
exit 1
fi
sudo systemctl is-active --quiet newrelic-infra || (echo "The infrastructure agent is required to install this integration, we recommend going through our guided install path for this pre-requisite which can be found here: https://docs.newrelic.com/docs/new-relic-guided-installation-overview" >> /dev/stderr; exit 1)
- |
CHECK_DB=$(mysql -u{{.NR_CLI_DB_USERNAME}} --port {{.NR_CLI_DB_PORT}} -p{{.NR_CLI_DB_PASSWORD}} -e "SHOW GRANTS FOR CURRENT_USER" 2>&1 | grep -v "mysql: [Warning] Using a password on the command line interface can be insecure." | grep 'GRANT SELECT' | awk '{print $2, $3}')
EXPECTED_SELECT_REPLICATION=$(echo 'SELECT, REPLICATION')
Expand Down
6 changes: 1 addition & 5 deletions recipes/newrelic/infrastructure/ohi/mysql/rhel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,7 @@ install:
assert_pre_req:
cmds:
- |
sudo systemctl is-active --quiet newrelic-infra
if [ $? -ne 0 ]; then
echo "The newrelic-infra agent service is not installed on the host, but is required to install this integration." >> /dev/stderr
exit 1
fi
sudo systemctl is-active --quiet newrelic-infra || (echo "The infrastructure agent is required to install this integration, we recommend going through our guided install path for this pre-requisite which can be found here: https://docs.newrelic.com/docs/new-relic-guided-installation-overview" >> /dev/stderr; exit 1)
- |
CHECK_DB=$(mysql -u{{.NR_CLI_DB_USERNAME}} --port {{.NR_CLI_DB_PORT}} -p{{.NR_CLI_DB_PASSWORD}} -e "SHOW GRANTS FOR CURRENT_USER" 2>&1 | grep -v "mysql: [Warning] Using a password on the command line interface can be insecure." | grep 'GRANT ALL\|SELECT' | awk '{print $2, $3}')
EXPECTED_SELECT_REPLICATION=$(echo 'SELECT, REPLICATION')
Expand Down
6 changes: 1 addition & 5 deletions recipes/newrelic/infrastructure/ohi/mysql/suse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,7 @@ install:
assert_pre_req:
cmds:
- |
sudo systemctl is-active --quiet newrelic-infra
if [ $? -ne 0 ]; then
echo "The newrelic-infra agent service is not installed on the host, but is required to install this integration." >> /dev/stderr
exit 1
fi
sudo systemctl is-active --quiet newrelic-infra || (echo "The infrastructure agent is required to install this integration, we recommend going through our guided install path for this pre-requisite which can be found here: https://docs.newrelic.com/docs/new-relic-guided-installation-overview" >> /dev/stderr; exit 1)
- |
CHECK_DB=$(mysql -u{{.NR_CLI_DB_USERNAME}} --port {{.NR_CLI_DB_PORT}} -p{{.NR_CLI_DB_PASSWORD}} -e "SHOW GRANTS FOR CURRENT_USER" 2>&1 | grep -v "mysql: [Warning] Using a password on the command line interface can be insecure." | grep 'GRANT SELECT' | awk '{print $2, $3}')
EXPECTED_SELECT_REPLICATION=$(echo 'SELECT, REPLICATION')
Expand Down
6 changes: 1 addition & 5 deletions recipes/newrelic/infrastructure/ohi/nagios/debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,7 @@ install:
assert_pre_req:
cmds:
- |
sudo systemctl is-active --quiet newrelic-infra
if [ $? -ne 0 ]; then
echo "The newrelic-infra agent service is not installed on the host, but is required to install this integration." >> /dev/stderr
exit 1
fi
sudo systemctl is-active --quiet newrelic-infra || (echo "The infrastructure agent is required to install this integration, we recommend going through our guided install path for this pre-requisite which can be found here: https://docs.newrelic.com/docs/new-relic-guided-installation-overview" >> /dev/stderr; exit 1)
- |
PLUGINS_EXIST=$(ls /usr/local/nagios/libexec | grep check_users | wc -l)
if [ $PLUGINS_EXIST -eq 0 ] ; then
Expand Down
Loading

0 comments on commit a089678

Please sign in to comment.