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

Execs are not scheduled by default #6

Closed
MattRiesterer opened this issue Feb 9, 2017 · 8 comments
Closed

Execs are not scheduled by default #6

MattRiesterer opened this issue Feb 9, 2017 · 8 comments
Labels

Comments

@MattRiesterer
Copy link

The documentation states that

# Optional cron expression, defines when to execute the command.
# Default is every 1 minute.
#cron:

https://github.com/christiangalsterer/execbeat/blob/master/execbeat.yml

Using this configuration did not schedule any execs. Only after setting the cron value specifically like

cron: "@every 10s"

triggered the execs as expected.

Occurred with execbeat v2.1.1 and v2.2.0 using the amd64.deb package on Linux.

As most people will try first using the provided configuration, you might consider fixing this. It took me a while to figure this out.

Keep up the great work!

thanks a lot

Matthias

@christiangalsterer
Copy link
Owner

Hi Matthias,

thanks raising this. I'm currently travelling and will look into it in about a week from now.

@christiangalsterer
Copy link
Owner

I just tried it and it works for me. The default is one minute, i.e. you have to wait one minute after starting the beat until you see any output.
Did you wait for a minute and/or can check again?

@christiangalsterer
Copy link
Owner

Hi Matthias,

did you had a chance to check again of the scheduler is triggered after a minute has passed?

@MattRiesterer
Copy link
Author

Hi Christian,

I'm sorry for replying this late, I somehow haven't seen the previous github notifications.

I can confirm that having croncommented out does not trigger the exec periodically.

config

execbeat:

execs:
    -
      command: echo
      args: "hello"
      #cron: "@every 10s"

log

# tail -f /var/log/execbeat/execbeat
2017-02-18T08:16:03+01:00 INFO Flush Interval set to: 1s
2017-02-18T08:16:03+01:00 INFO Max Bulk Size set to: 2048
2017-02-18T08:16:03+01:00 DBG  create bulk processing worker (interval=1s, bulk size=2048)
2017-02-18T08:16:03+01:00 INFO execbeat start running.
2017-02-18T08:16:03+01:00 INFO execbeat is running! Hit CTRL-C to stop it.
2017-02-18T08:16:03+01:00 DBG  Creating poller # 0 with command: echo
2017-02-18T08:16:03+01:00 INFO Metrics logging every 30s
2017-02-18T08:16:33+01:00 INFO No non-zero metrics in the last 30s
2017-02-18T08:17:03+01:00 INFO No non-zero metrics in the last 30s
2017-02-18T08:17:33+01:00 INFO No non-zero metrics in the last 30s
2017-02-18T08:18:03+01:00 INFO No non-zero metrics in the last 30s

So the poller started at 08:16:03 but did not emit any message until 08:18:03. So I waited two minutes.

while with config

execs:
    -
      command: echo
      args: "hello"
      cron: "@every 10s"

log shows

2017-02-18T08:19:05+01:00 DBG  Disable stderr logging
2017-02-18T08:19:05+01:00 INFO Home path: [/usr/share/execbeat] Config path: [/etc/execbeat] Data path: [/var/lib/execbeat] Logs path: [/var/log/execbeat]
2017-02-18T08:19:05+01:00 INFO Setup Beat: execbeat; Version: 2.2.0
2017-02-18T08:19:05+01:00 INFO Max Retries set to: 3
2017-02-18T08:19:05+01:00 INFO Activated logstash as output plugin.
2017-02-18T08:19:05+01:00 DBG  Create output worker
2017-02-18T08:19:05+01:00 DBG  No output is defined to store the topology. The server fields might not be filled.
2017-02-18T08:19:05+01:00 INFO Flush Interval set to: 1s
2017-02-18T08:19:05+01:00 INFO Max Bulk Size set to: 2048
2017-02-18T08:19:05+01:00 DBG  create bulk processing worker (interval=1s, bulk size=2048)
2017-02-18T08:19:05+01:00 INFO execbeat start running.
2017-02-18T08:19:05+01:00 INFO execbeat is running! Hit CTRL-C to stop it.
2017-02-18T08:19:05+01:00 DBG  Creating poller # 0 with command: echo
2017-02-18T08:19:05+01:00 INFO Metrics logging every 30s
2017-02-18T08:19:15+01:00 DBG  Executing command: [echo] with args [%!w(string=hello)]
2017-02-18T08:19:15+01:00 DBG  Error trying to unmarshal %!s(<nil>)
2017-02-18T08:19:15+01:00 DBG  Publish: {
  "@timestamp": "2017-02-18T07:19:15.001Z",
  "beat": {

...

The poller started at 08:19:05 and emitted the first message at 08:19:15. That's exactly 10 seconds after the start as configured.

I'm running this example on a debian64 vagrant box (for development purposes). Pretty standard. Not sure what else I can provide to help you to dig into the issue. If there's something, please just let me know.

Thank you and best regards,

matthias

@christiangalsterer
Copy link
Owner

Hi Matthias,

no problem ;-)
I was able to reproduce the problem now with the deb package on a Ubuntu Server 16.10.

@christiangalsterer
Copy link
Owner

I also tried the tar.gz version on Ubuntu and also there the default triggering is not working. On a mac it works without any issues. Need to further look into this.

@christiangalsterer
Copy link
Owner

I finally found the issue. It will be fixed with the next version 3.0.0 which I plan to release in a few days.

@christiangalsterer
Copy link
Owner

christiangalsterer commented Feb 19, 2017

Just released version 3.0.0. Please note the release notes as there are some configuration changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants