Commit Graph

25 Commits

Author SHA1 Message Date
Bart Vercoulen
a4e09a2c37
Merge branch 'master' into tail 2019-02-15 10:53:21 +01:00
Bart Vercoulen
d73bd20065
Fixed formatting. 2019-02-15 10:41:53 +01:00
Bart Vercoulen
f51b1f882d
Refactored to kingpin and fixed a EOF bug in CollectShowqFromReader. 2018-12-17 17:01:01 +01:00
Mario Trangoni
4d195655fd postfix_exporter.go: Fix megacheck issues
See,
$ gometalinter --vendor --deadline 10m --disable-all --enable=megacheck ./...
postfix_exporter.go:97:17⚠️ should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (S1007) (megacheck)
postfix_exporter.go:276:40⚠️ should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (S1007) (megacheck)
postfix_exporter.go:277:40⚠️ should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (S1007) (megacheck)
postfix_exporter.go:278:40⚠️ should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (S1007) (megacheck)
postfix_exporter.go:279:40⚠️ should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (S1007) (megacheck)
postfix_exporter.go:280:40⚠️ should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (S1007) (megacheck)
postfix_exporter.go:281:40⚠️ should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (S1007) (megacheck)
postfix_exporter.go:282:40⚠️ should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (S1007) (megacheck)
postfix_exporter.go:283:40⚠️ should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (S1007) (megacheck)
postfix_exporter.go:284:40⚠️ should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (S1007) (megacheck)
postfix_exporter.go:285:40⚠️ should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (S1007) (megacheck)

Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>
2018-12-16 10:56:41 +01:00
Mario Trangoni
76f8dd448b postfix_exporter.go: Comment out unused CollectShowqFromFile function
See,
$ gometalinter --vendor ./...
postfix_exporter.go:256:1⚠️ CollectShowqFromFile is unused
(deadcode)
2018-12-04 16:50:01 +01:00
Mario Trangoni
7fa2e37607 postfix_exporter.go: Fix some gosec issues.
See,
$ gometalinter --vendor ./...
postfix_exporter.go:249:⚠️ Potential file inclusion via variable,MEDIUM,HIGH (gosec)
postfix_exporter.go:80:⚠️ Errors unhandled.,LOW,HIGH (gosec)
postfix_exporter.go:121:⚠️ Errors unhandled.,LOW,HIGH (gosec)
postfix_exporter.go:296:⚠️ Errors unhandled.,LOW,HIGH (gosec)
postfix_exporter.go:298:⚠️ Errors unhandled.,LOW,HIGH (gosec)
postfix_exporter.go:300:⚠️ Errors unhandled.,LOW,HIGH (gosec)
postfix_exporter.go:302:⚠️ Errors unhandled.,LOW,HIGH (gosec)
postfix_exporter.go:309:⚠️ Errors unhandled.,LOW,HIGH (gosec)
postfix_exporter.go:311:⚠️ Errors unhandled.,LOW,HIGH (gosec)
postfix_exporter.go:313:⚠️ Errors unhandled.,LOW,HIGH (gosec)
postfix_exporter.go:315:⚠️ Errors unhandled.,LOW,HIGH (gosec)
postfix_exporter.go:322:⚠️ Errors unhandled.,LOW,HIGH (gosec)
postfix_exporter.go:324:⚠️ Errors unhandled.,LOW,HIGH (gosec)
postfix_exporter.go:333:⚠️ Errors unhandled.,LOW,HIGH (gosec)
postfix_exporter.go:335:⚠️ Errors unhandled.,LOW,HIGH (gosec)
postfix_exporter.go:337:⚠️ Errors unhandled.,LOW,HIGH (gosec)
postfix_exporter.go:339:⚠️ Errors unhandled.,LOW,HIGH (gosec)
postfix_exporter.go:650:⚠️ Errors unhandled.,LOW,HIGH (gosec)
2018-12-04 16:48:06 +01:00
Evan Klitzke
b137412906
When following log files, tail them rather than truncate them. 2018-09-30 15:28:04 -07:00
Silke
0c405faf87 Add nosystemd build tag
This allows building the exporter without systemd headers, eg:

    env CGO_ENABLED=0 go build -tags nosystemd

Closes #11
2018-04-19 13:34:18 +02:00
WilliButz
ec3a8e5444
fix non-updating metrics from systemd-journal
fixes #10 where metrics metrics collected from the
systemd journal were not updated after some time
2018-04-15 15:47:06 +02:00
Bart Vercoulen
c1995d48d3 Comments added. 2018-02-07 15:12:35 +01:00
Bart Vercoulen
6569ec9d20 Initialize histograms to zero 2018-02-07 14:24:08 +01:00
Silke
82c04256dc Implement collection from the systemd journal
The following flags configure this usage:

- systemd.enable:       enable collection from systemd.
- systemd.unit:         systemd unit, postfix.service by default.
- systemd.slice:        systemd slice, overrides the unit.
- systemd.journal_path: path to the systemd journal directory.

Closes #2
2018-01-28 15:09:32 +01:00
Ed Schouten
a8b4bed735 Fix another poorly named metric. 2017-06-01 14:30:55 +02:00
Ed Schouten
c5b05341a3 Improve metric naming.
Rename the queue_* metrics to showq_*, named after the other processes.
Also add a missing _total suffix to the SASL failures metric.
2017-06-01 14:26:00 +02:00
Ed Schouten
a907c85658 Parse showq timestamps in the right timezone. 2017-05-29 14:51:46 +02:00
Ed Schouten
9b56cf9737 Also start scraping Postfix's log file for more relevant stats.
Queue stats on their own are a bit restrictive. Also go ahead and scrape
the Postfix logs to get more relevant metrics.
2017-05-02 15:07:19 +02:00
Ed Schouten
c4e1ef1c0e Use assignment instead of declaration. 2017-04-18 16:09:22 +02:00
Ed Schouten
c3262ed850 Add the name of the message queue as a label.
Instead of providing stats for all messages collectively, it would make
more sense to group them by queue. That way it's possible to alert on
the number of active, deferred, etc. messages.

For Postfix 2.x there isn't a lot we can do, as there only is a single
ASCII character distinguishing between two queues specifically.
2017-04-18 16:03:53 +02:00
Ed Schouten
1df13fe2c1 Add support for Postfix 3.x's binary showq format.
This should fix issue #1. Tested on the example provided.
2017-03-17 16:42:54 +01:00
Ed Schouten
ca8f969166 Repurpose the existing port number intended for Postfix exporters. 2017-02-17 15:53:56 +01:00
Ed Schouten
4d4fa0de81 Use the right package name. This isn't meant for Unbound. 2017-02-17 15:50:47 +01:00
Ed Schouten
ccf97c55a5 Don't forget to assign the resulting date. 2017-02-17 15:47:45 +01:00
Ed Schouten
77eb147a0c Pick a less insane port number.
I will eventually allocate an official port number when this gets open
sourced.
2017-02-17 15:31:45 +01:00
Ed Schouten
d39bb4793c Document the code a bit more. 2017-02-17 15:31:04 +01:00
Ed Schouten
1e8a6b282d Check in an initial copy of our Postfix metrics exporter. 2017-02-17 15:29:37 +01:00