5.1.3.2.6. Trending checks
In this section we can find automated checks that allow us to know the state of the trending of an environment and to be able to identify the errors related to them.
These automated checks can be find in the all_checks.yml
file of the following path:
cd /usr/share/opennac/ansible/
The following points detail the different checks that ansible performs in an automated way as well as the tags available when executing them.
5.1.3.2.6.1. Checks
Ensure that the collectd configuration files are ok for every node
Ensure that the data is being reported correctly in the last 5 minuts
Ensure that the nodes are correctly reporting and find the ones that should not be reporting
5.1.3.2.6.3. Data Structure
"trending": {
"configuredFiles": {
"{{ node_id }}": {
"error": [],
"hostname": "{{ node_hostname }}",
"ip": "{{ node_ip }}",
"ok": [
"{{ collectd_file_name }}"
]
}
},
"reportingFolders": {
"{{ node_id }}": {
"folders": [
{
"found": true,
"name": "{{ collectd_folder_name }}",
"outdated": true
}
]
}
},
"reportingNodes": {
"error": [
"{{ extra_folder }}"
],
"missing": {
"{{ node_id }}": "{{ node_ip }}"
},
"ok": {
"{{ node_id }}": "{{ node_ip }}"
}
},
"{{ node_id }}": {
"hostname": "{{ node_hostname }}",
"ip": "{{ node_ip }}",
"error": {},
"ok": {
"{{ node_id }}": "{{ node_ip }}"
}
}
}
The data structure shown is explained below:
configured_files: contains a list of the nodes and file paths that have been configured in the trending.
node_id: corresponds to the hostname of the node and contains the trending information of the node.
hostname: node hostname.
ip: node IP address.
ok: list of paths with the configured files.
error: .
reportingFolders:
reportingNodes: list of nodes that have reported trending.
5.1.3.2.6.4. Example
Command:
ansible-playbook -i inventory all_checks.yml --tags "trending"
Output:
"trending": {
"configuredFiles": {
"02-captive-12": {
"error": [],
"hostname": "02-captive-12",
"ip": "10.10.39.105",
"ok": [
"/etc/collectd.d/conntrack.conf",
"/etc/collectd.d/disk.conf",
"/etc/collectd.d/network.conf",
"/etc/collectd.d/redis.conf",
"/etc/collectd.d/types.conf"
]
}
},
"reportingFolders": {
"02-captive-12": {
"folders": [
{
"found": true,
"name": "conntrack",
"outdated": true
}
]
}
},
"reportingNodes": {
"error": [
"test"
],
"missing": {
"02-captive-12": "10.10.39.112",
"02-vpngw-09": "10.10.39.109"
},
"ok": {
"02-aggregator-07": "10.10.39.107",
"02-analytics-04": "10.10.39.104",
"02-analytics-05": "10.10.39.105",
"02-analytics-06": "10.10.39.106",
"02-principal-01": "10.10.39.101",
"02-proxy-02": "10.10.39.102",
"02-sensor-08": "10.10.39.17",
"02-worker-03": "10.10.39.103"
}
}
}