observIQ / disk-usage

Trigger slack alerts when disk usage is too high
BSD 2-Clause "Simplified" License
4 stars 0 forks source link

lock is removed even when slack notification times out #5

Closed jsirianni closed 4 years ago

jsirianni commented 6 years ago

edit: see comments for root cause

While testing a freebsd implementation, I noticed slack notifications tended to lag a big.. which caused a timeout. The lock file was removed, despite the failed alert.

Disk usage healthy: /
Lock removed
dial tcp: i/o timeout
Failed to send alert!
root@fw-prod:~ # 
root@fw-prod:~ # 
root@fw-prod:~ # 
root@fw-prod:~ # ./disk-usage-bsd.bin -t 70 -c alerts -slack-url https://hooks.slack.com/services/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
jsirianni commented 6 years ago

The timeout seems to only occur when removing the lock

jsirianni commented 6 years ago

When replicating the issue on linux, I get the following error.

dial tcp: lookup smtp.domain.localnet on 10.1.30.2:53: no such host

Turns out, I was not passing -s for enabling slack. We should set slack to true if a url is passed, and possible remove the -s flag entirely.

jsirianni commented 4 years ago

resolved https://github.com/BlueMedoraPublic/disk-usage/releases/tag/2.0.0