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

WARNING: STDIN provided but not specified via '-' #73

Closed
jarretlavallee opened this issue Dec 21, 2020 · 0 comments · Fixed by #75
Closed

WARNING: STDIN provided but not specified via '-' #73

jarretlavallee opened this issue Dec 21, 2020 · 0 comments · Fixed by #75
Labels
bug Something isn't working

Comments

@jarretlavallee
Copy link
Contributor

Describe the Bug

When shipping metrics, the following warning is displayed in the output.

WARNING: STDIN provided but not specified via '-'

This can result in an email every 5 minutes for each service. This warning should be suppressed or fixed

Expected Behavior

The warning should not come up.

Steps to Reproduce

Include the main class and add the following to hiera. These parameters can also be in the class declaration.

puppet_metrics_collector::metrics_server_type: influxdb
puppet_metrics_collector::metrics_server_hostname: influxdb.example.lab
puppet_metrics_collector::metrics_server_port: 80
puppet_metrics_collector::metrics_server_db_name: puppet_metrics

Run the cronjob

[root@puppet ~]# /opt/puppetlabs/puppet-metrics-collector/scripts/tk_metrics --metrics_type puppetserver --output_dir /opt/puppetlabs/puppet-metrics-collector/puppetserver | /opt/puppetlabs/puppet-metrics-collector/scripts/json2timeseriesdb --netcat influxdb.example.lab --convert-to influxdb --port 80 --influx-db puppet_metrics > /dev/null
WARNING: STDIN provided but not specified via '-'

Proposed solution.

Based on https://github.com/puppetlabs/puppetlabs-puppet_metrics_collector/blob/master/files/json2timeseriesdb#L367-L370 we can append - to the end of the command.

/opt/puppetlabs/puppet-metrics-collector/scripts/tk_metrics --metrics_type puppetserver --output_dir /opt/puppetlabs/puppet-metrics-collector/puppetserver | /opt/puppetlabs/puppet-metrics-collector/scripts/json2timeseriesdb --netcat influxdb.example.lab --convert-to influxdb --port 80 --influx-db puppet_metrics - > /dev/null

Testing this is successful.

[root@puppet ~]# /opt/puppetlabs/puppet-metrics-collector/scripts/tk_metrics --metrics_type puppetserver --output_dir /opt/puppetlabs/puppet-metrics-collector/puppetserver | /opt/puppetlabs/puppet-metrics-collector/scripts/json2timeseriesdb --netcat influxdb.home.lab --convert-to influxdb --port 80 --influx-db puppet_metrics - > /dev/null
[root@puppet ~]# /opt/puppetlabs/puppet-metrics-collector/scripts/tk_metrics --metrics_type puppetserver --output_dir /opt/puppetlabs/puppet-metrics-collector/puppetserver | /opt/puppetlabs/puppet-metrics-collector/scripts/json2timeseriesdb --netcat influxdb.example.lab --convert-to influxdb --port 80 --influx-db puppet_metrics -
POST: http://influxdb.example.lab/write?db=puppet_metrics&precision=s 204
@jarretlavallee jarretlavallee added the bug Something isn't working label Dec 21, 2020
jarretlavallee pushed a commit to jarretlavallee/puppetlabs-puppet_metrics_collector that referenced this issue Dec 21, 2020
Prior to this commit, a warning would be presented when shipping metrics
using the json2timeseriesdb streaming. This commit adds a - to the the
command to stop the warning.
Sharpie added a commit that referenced this issue Dec 29, 2020
(gh-73) Append - to the metric command for json2timeseriesdb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant