Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

templates: deactivate stderr of collectd if it monitors airos_6 #769

Merged
merged 1 commit into from
Feb 10, 2024

Conversation

FFHener
Copy link
Contributor

@FFHener FFHener commented Feb 9, 2024

When collectd wants to get the Names of Stations via snmp connnected to a device running AirOS 6 that have none connected it reports a "NoSuchName" error to logd resulting in a lots of logspamming. At chris-core it was 60 per minute.

This Script will change the option "procd_set_param stderr 1" to "0" in the file /etc/init.d/collectd to deactivate logging of all errors. The monitoring will still work. I prefer not having logs over logspamming as the logfiles will get useless otherwise. It is still possible to change this option back to 1 until next boot to get a better insight when debugging collectd-issues.

This fixes #766

{% if snmp_devices|selectattr('snmp_profile', 'equalto', 'airos_6')|list|length > 0 %}
# Change the option "procd_set_param stderr 1" to "0" in the file /etc/init.d/collectd
# This is needed because airos_6 APs w/o stations resulted in a lot of local log spamming
sed -i 's/\(procd_set_param stderr\)[[:space:]]*1/\1 0/' /etc/init.d/collectd
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sed -i 's/\(procd_set_param stderr\)[[:space:]]\{1,\}1/\1 0/' /etc/init.d/collectd would be more precise as it requires at least one space to be present.

Copy link
Member

@Noki Noki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me

When collectd wants to get the Names of Stations via snmp connnected
to a device running AirOS 6 that have none connected it reports a
"NoSuchName" error to logd resulting in a lots of logspamming. At
chris-core it was 60 per minute.

This Script will change the option "procd_set_param stderr  1" to "0"
in the file /etc/init.d/collectd to deactivate logging of all errors.
The monitoring will still work. I prefer not having logs over logspamming
as the logfiles will get useless otherwise. It is still possible to
change this option back to 1 until next boot to get a better insight
when debugging collectd-issues.

This fixes #766
@FFHener FFHener merged commit f955453 into master Feb 10, 2024
4 checks passed
@FFHener FFHener deleted the collectd-logging branch February 10, 2024 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

collectd: disable logging for locations with AirOS 6 snmp_profiles
2 participants