Skip to content

Commit

Permalink
fix telegraf socket path to avoid reboot error
Browse files Browse the repository at this point in the history
  • Loading branch information
arstercz committed Apr 19, 2022
1 parent 7c68344 commit e99a790
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion scripts/deb/post-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ EOF
if [[ ! -f /etc/telegraf/telegraf.d/socket_listener.conf ]]; then
cat <<EOF >> /etc/telegraf/telegraf.d/socket_listener.conf
[[inputs.socket_listener]]
service_address = "unix:///var/run/telegraf/telegraf.sock"
service_address = "unix:///var/log/telegraf/telegraf.sock"
max_connections = 128
read_timeout = "10s"
data_format = "graphite"
Expand Down
2 changes: 1 addition & 1 deletion scripts/rpm/post-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ EOF
if [[ ! -f /etc/telegraf/telegraf.d/socket_listener.conf ]]; then
cat <<EOF >> /etc/telegraf/telegraf.d/socket_listener.conf
[[inputs.socket_listener]]
service_address = "unix:///var/run/telegraf/telegraf.sock"
service_address = "unix:///var/log/telegraf/telegraf.sock"
max_connections = 128
read_timeout = "10s"
data_format = "graphite"
Expand Down
4 changes: 2 additions & 2 deletions scripts/telegraf-discover
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ my $conf = "/etc/telegraf/telegraf.conf";
my $confd = "/etc/telegraf/telegraf.d";
my $default = "/etc/default/telegraf";
my $disf = "/etc/telegraf/discover.conf";
my $sock = "/var/run/telegraf/telegraf.sock";
my $sock = "/var/log/telegraf/telegraf.sock";
my $token = "";
my $server;
my $scheme;
Expand Down Expand Up @@ -826,7 +826,7 @@ sub new {
$self->{update} = $args{update} || 0;
$self->{timeout} = $args{timeout} || 3;
$self->{metas} = Utils::get_default_meta($self->{default});
$self->{sockfile}= $args{sockfile} || '/var/run/telegraf/telegraf.sock';
$self->{sockfile}= $args{sockfile} || '/var/log/telegraf/telegraf.sock';

return undef unless defined $self->{servers}->[0];
return bless $self, $class;
Expand Down

0 comments on commit e99a790

Please sign in to comment.