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

Handle NaN values by replacing with 0 (zero) to allow publishing to CloudWatch #78

Open
seans11 opened this issue Jan 17, 2019 · 0 comments

Comments

@seans11
Copy link

seans11 commented Jan 17, 2019

I am attempting to use the Collectd Tail Plugin for tracking my Postfix log file. I would like to publish Postfix frequency metrics to CloudWatch using the DSType:CountInc/Type:frequency (value:gauge:0:U) settings. I am using the csv plugin to view the output and it appears that Collectd is recording "nan" for the intervals where no metrics are received from the Postfix log file. With CloudWatch you are unable to publish "nan" values. Is there a method or setting I am missing that would allow me to substitute "nan" with "0" in publishing to CloudWatch? During the intervals where nan results occur, CloudWatch metrics do not get recorded resulting in a broken chart.

Plugin tail configuration:

<Plugin "tail">
<File "/var/log/maillog">
    Instance "postfix"
    Interval 60
    #Since 5.8, Collectd supports new options:
    #Plugin "postfix"
    #Instance "main"

    # number of connections
    # (incoming)
    <Match>
      Regex "\\<postfix\\/smtpd\\[[0-9]+\\]: connect from\\>"
      DSType "GaugeInc"
      Type "frequency"
      Instance "connection-in-open"
    </Match>
    <Match>
      Regex "\\<postfix\\/smtpd\\[[0-9]+\\]: disconnect from\\>"
      DSType "GaugeInc"
      Type "frequency"
      Instance "connection-in-close"
    </Match>
</File>
</Plugin>

Output sample of csv plugin for one of the Postfix metrics:

1547744157.415,nan
1547744217.415,nan
1547744277.415,nan
1547744337.415,nan
1547744397.415,nan
1547744457.415,1.000000
1547744517.415,nan
1547744577.415,nan
1547744637.415,nan
1547744697.415,nan
1547744757.415,nan
1547744817.415,nan

Output of what I would like to see:

1547744277.415,0
1547744337.415,0
1547744397.415,0
1547744457.415,1.000000
1547744517.415,0
1547744577.415,0
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

No branches or pull requests

1 participant