Skip to content

Commit

Permalink
Apply tool/packagize.pl
Browse files Browse the repository at this point in the history
\ls | grep check- | xargs -L 1 perl tool/packagize.pl
  • Loading branch information
Songmu committed Mar 3, 2017
1 parent 73e586f commit 87bd7bf
Show file tree
Hide file tree
Showing 77 changed files with 255 additions and 71 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package checkawssqsqueuesize

import (
"fmt"
Expand All @@ -14,7 +14,8 @@ import (
"time"
)

func main() {
// Do the plugin
func Do() {
ckr := run(os.Args[1:])
ckr.Name = "SQSQueueSize"
ckr.Exit()
Expand Down
7 changes: 7 additions & 0 deletions check-aws-sqs-queue-size/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package main

import "github.com/mackerelio/go-check-plugins/check-aws-sqs-queue-size/lib"

func main() {
checkawssqsqueuesize.Do()
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package checkcertfile

import (
"crypto/x509"
Expand All @@ -17,7 +17,8 @@ type certOpts struct {
Warn int64 `short:"w" long:"warning" default:"30" description:"The threshold in days before expiry"`
}

func main() {
// Do the plugin
func Do() {
ckr := checkCertExpiration()
ckr.Name = "CERT Expiry"
ckr.Exit()
Expand Down
7 changes: 7 additions & 0 deletions check-cert-file/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package main

import "github.com/mackerelio/go-check-plugins/check-cert-file/lib"

func main() {
checkcertfile.Do()
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package checkelasticsearch

import (
"encoding/json"
Expand All @@ -22,7 +22,8 @@ var opts struct {
Port int64 `short:"p" long:"port" default:"9200" description:"Elasticsearch port"`
}

func main() {
// Do the plugin
func Do() {
ckr := run(os.Args[1:])
ckr.Name = "Elasticsearch"
ckr.Exit()
Expand Down
7 changes: 7 additions & 0 deletions check-elasticsearch/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package main

import "github.com/mackerelio/go-check-plugins/check-elasticsearch/lib"

func main() {
checkelasticsearch.Do()
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package checkfileage

import (
"fmt"
Expand All @@ -9,7 +9,8 @@ import (
"github.com/mackerelio/checkers"
)

func main() {
// Do the plugin
func Do() {
ckr := run(os.Args[1:])
ckr.Name = "FileAge"
ckr.Exit()
Expand Down
7 changes: 7 additions & 0 deletions check-file-age/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package main

import "github.com/mackerelio/go-check-plugins/check-file-age/lib"

func main() {
checkfileage.Do()
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package checkfilesize

import (
"fmt"
Expand All @@ -13,7 +13,8 @@ import (
"github.com/mackerelio/checkers"
)

func main() {
// Do the plugin
func Do() {
ckr := run(os.Args[1:])
ckr.Name = "FileSize"
ckr.Exit()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package checkfilesize

import (
"fmt"
Expand Down
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions check-file-size/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package main

import "github.com/mackerelio/go-check-plugins/check-file-size/lib"

func main() {
checkfilesize.Do()
}
5 changes: 3 additions & 2 deletions check-http/check_http.go → check-http/lib/check_http.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package checkhttp

import (
"fmt"
Expand All @@ -18,7 +18,8 @@ var opts struct {
NoCheckCertificate bool `long:"no-check-certificate" description:"Do not check certificate"`
}

func main() {
// Do the plugin
func Do() {
ckr := run(os.Args[1:])
ckr.Name = "HTTP"
ckr.Exit()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package checkhttp

import (
"testing"
Expand Down
7 changes: 7 additions & 0 deletions check-http/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package main

import "github.com/mackerelio/go-check-plugins/check-http/lib"

func main() {
checkhttp.Do()
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package checkjmxjolokia

import (
"encoding/json"
Expand Down Expand Up @@ -28,7 +28,8 @@ type jmxJolokiaResponse struct {
Value float64
}

func main() {
// Do the plugin
func Do() {
ckr := run(os.Args[1:])
ckr.Name = "Jmx-Jolokia"
ckr.Exit()
Expand Down
7 changes: 7 additions & 0 deletions check-jmx-jolokia/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package main

import "github.com/mackerelio/go-check-plugins/check-jmx-jolokia/lib"

func main() {
checkjmxjolokia.Do()
}
5 changes: 3 additions & 2 deletions check-load/check_load.go → check-load/lib/check_load.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package checkload

import (
"errors"
Expand Down Expand Up @@ -36,7 +36,8 @@ func parseThreshold(str string) ([3]float64, error) {
return thresholds, nil
}

func main() {
// Do the plugin
func Do() {
ckr := run(os.Args[1:])
ckr.Name = "LOAD"
ckr.Exit()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package checkload

import (
"os/exec"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package checkload

import (
"fmt"
Expand Down
7 changes: 7 additions & 0 deletions check-load/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package main

import "github.com/mackerelio/go-check-plugins/check-load/lib"

func main() {
checkload.Do()
}
5 changes: 3 additions & 2 deletions check-log/check-log.go → check-log/lib/check-log.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package checklog

import (
"bufio"
Expand Down Expand Up @@ -97,7 +97,8 @@ func (opts *logOpts) prepare() error {
return nil
}

func main() {
// Do the plugin
func Do() {
ckr := run(os.Args[1:])
ckr.Name = "LOG"
ckr.Exit()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package checklog

import (
"fmt"
Expand Down
7 changes: 7 additions & 0 deletions check-log/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package main

import "github.com/mackerelio/go-check-plugins/check-log/lib"

func main() {
checklog.Do()
}
5 changes: 3 additions & 2 deletions check-mailq/check_mailq.go → check-mailq/lib/check_mailq.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package checkmailq

import (
"fmt"
Expand All @@ -12,7 +12,8 @@ import (
"github.com/mackerelio/checkers"
)

func main() {
// Do the plugin
func Do() {
ckr := run(os.Args[1:])
ckr.Name = "Mailq"
ckr.Exit()
Expand Down
7 changes: 7 additions & 0 deletions check-mailq/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package main

import "github.com/mackerelio/go-check-plugins/check-mailq/lib"

func main() {
checkmailq.Do()
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package checkmasterha

import (
"bytes"
Expand All @@ -11,7 +11,8 @@ import (
"github.com/mackerelio/checkers"
)

func main() {
// Do the plugin
func Do() {
var opts options
parser := flags.NewParser(&opts, flags.Default)
if _, err := parser.Parse(); err != nil {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package checkmasterha

import (
"strconv"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package checkmasterha

import (
"testing"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package checkmasterha

import (
"strings"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package checkmasterha

import (
"testing"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package checkmasterha

import (
"strings"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package checkmasterha

import (
"testing"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package checkmasterha

import (
"os"
Expand Down
File renamed without changes.
7 changes: 7 additions & 0 deletions check-masterha/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package main

import "github.com/mackerelio/go-check-plugins/check-masterha/lib"

func main() {
checkmasterha.Do()
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package checkmemcached

import (
"os"
Expand All @@ -16,7 +16,8 @@ var opts struct {
Key string `short:"k" long:"key" required:"true" description:"Cache key used within set and get test"`
}

func main() {
// Do the plugin
func Do() {
ckr := run(os.Args[1:])
ckr.Name = "Memcached"
ckr.Exit()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package checkmemcached

import (
"fmt"
Expand Down
7 changes: 7 additions & 0 deletions check-memcached/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package main

import "github.com/mackerelio/go-check-plugins/check-memcached/lib"

func main() {
checkmemcached.Do()
}
5 changes: 3 additions & 2 deletions check-mysql/check-mysql.go → check-mysql/lib/check-mysql.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package checkmysql

import (
"fmt"
Expand Down Expand Up @@ -30,7 +30,8 @@ func separateSub(argv []string) (string, []string) {
return argv[0], argv[1:]
}

func main() {
// Do the plugin
func Do() {
subCmd, argv := separateSub(os.Args[1:])
fn, ok := commands[subCmd]
if !ok {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package checkmysql

import (
"fmt"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package checkmysql

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion check-mysql/uptime.go → check-mysql/lib/uptime.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package checkmysql

import (
"fmt"
Expand Down
Loading

0 comments on commit 87bd7bf

Please sign in to comment.