Skip to content

Commit

Permalink
Updated types and metric names
Browse files Browse the repository at this point in the history
  • Loading branch information
drobinson-moj committed Nov 7, 2023
1 parent 2876b3d commit 7df6086
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ while sleep "$INTERVAL"; do
if [[ "$SIDS" != "None" ]]; then
for SID in $(get_sids); do
db_connected $SID >/dev/null 2>&1
echo "PUTVAL $HOSTNAME/exec-db_connected/bool-$SID interval=$INTERVAL N:$?"
echo "PUTVAL $HOSTNAME/oracle_db_connected/exitcode-$SID interval=$INTERVAL N:$?"
done
fi
done
8 changes: 7 additions & 1 deletion ansible/roles/collectd-service-metrics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ Intro to Collectd networking [here](https://collectd.org/wiki/index.php/Networki

## Finding metrics in Cloudwatch

Metrics collected by the Cloudwatch agent will appear in the 'metrics' panel under the CWAgent namespace as <cloudwatch_agent_config/metrics/metrics_collected/collectd/name_prefix>_<collectd_plugin_name>_value e.g. collectd_cpu_value, collectd_wlsadminserver_value, collectd_amazonssmagent_value etc.
Metrics collected by the Cloudwatch agent will appear in the 'metrics' panel under the CWAgent namespace

```
metric: collectd_service_status_value
type: exitcode
type_instance: Name of service, e.g. amazonssmagent
```

Cloudwatch metrics are easily filtered by instance_id so you can see all the metrics for a particular instance.
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ INTERVAL="${INTERVAL:-{{ collectd_script_interval }}}"
while sleep "$INTERVAL"; do
{% for item in collectd_monitored_services_role %}
({{ item.shell_cmd }}) >/dev/null 2>&1
echo "PUTVAL $HOSTNAME/{{ item.metric_name }}/bool interval=$INTERVAL N:$?"
echo "PUTVAL $HOSTNAME/service_status/exitcode-{{ item.metric_name }} interval=$INTERVAL N:$?"
{% endfor %}
{% for item in collectd_monitored_services_servertype %}
({{ item.shell_cmd }}) >/dev/null 2>&1
echo "PUTVAL $HOSTNAME/{{ item.metric_name }}/bool interval=$INTERVAL N:$?"
echo "PUTVAL $HOSTNAME/service_status/exitcode-{{ item.metric_name }} interval=$INTERVAL N:$?"
{% endfor %}
done
3 changes: 2 additions & 1 deletion ansible/roles/collectd/files/types.db.custom
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
bool value:GAUGE:0:1
bool value:GAUGE:0:1
exitcode value:GAUGE:U:U

0 comments on commit 7df6086

Please sign in to comment.