Discussion:
[influxdb] telegraf exec values in influxdb 0
b***@gmail.com
2016-02-16 19:03:39 UTC
Permalink
Have the following bash script that i'm using to monitor postfix queues.

----------------
#!/bin/bash
active=$(sudo find /var/spool/postfix/active -type f | wc -l)
deferred=$(sudo find /var/spool/postfix/deferred -type f | wc -l)
incoming=$(sudo find /var/spool/postfix/incoming -type f | wc -l)
maildrop=$(sudo find /var/spool/postfix/maildrop -type f | wc -l)

echo "mailque active=$active,deferred=$deferred,incoming=$incoming,maildrop=$maildrop"
----------------

the different queues have values, but when it is written to influxdb they are always 0. If i set the variables to a num (i.e. deferred=4) the measurement populates correctly in influxdb.

Here is my telegraf config for the exec...

----------------
[[inputs.exec]]
command = "/usr/local/bin/exec_postqs"
data_format = "influx"
----------------

What am I doing wrong?
--
Remember to include the InfluxDB version number with all issue reports
---
You received this message because you are subscribed to the Google Groups "InfluxDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to influxdb+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit https://groups.google.com/d/msgid/influxdb/1260dd73-02af-4582-8b35-268295b9d6b9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
j***@gmail.com
2017-08-27 14:06:38 UTC
Permalink
Hello Brit!
Post by b***@gmail.com
Have the following bash script that i'm using to monitor postfix queues.
----------------
#!/bin/bash
active=$(sudo find /var/spool/postfix/active -type f | wc -l)
deferred=$(sudo find /var/spool/postfix/deferred -type f | wc -l)
incoming=$(sudo find /var/spool/postfix/incoming -type f | wc -l)
maildrop=$(sudo find /var/spool/postfix/maildrop -type f | wc -l)
echo "mailque active=$active,deferred=$deferred,incoming=$incoming,maildrop=$maildrop"
----------------
SNIP
What am I doing wrong?
The problem might be with sudo. Sudo works by default in an interactive mode. Have a look at the man page for sudo. Namely -A and -b options.

I hope that helps.

Best regards, Ján
--
Remember to include the version number!
---
You received this message because you are subscribed to the Google Groups "InfluxData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to influxdb+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit https://groups.google.com/d/msgid/influxdb/620f1c57-1b7e-49fd-bec2-05ed2bba68d7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...