Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
langston-barrett committed Jul 10, 2015
1 parent 5964a4a commit 6733dc9
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 21 deletions.
10 changes: 1 addition & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
distributive
test.json
test.go
run.sh
<<<<<<< HEAD
bin/
.gvp/
.godeps/
.godeps/*
*.swp
*.rpm
*.bak
=======
bin/*
.gvp/*
*.swp
*.rpm
*.bak
*.rpm*.bak
>>>>>>> master
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ provides many services not included in Distributive, and solves a very different
problem. Distributive is simple, lightweight, and easy to configure, and
doesn't provide its own scheduling, dashboard, etc. It is designed to be used
within frameworks such as Sensu and Consul. Luckily, Distributive conforms to
[Nagios exit code specifications] [Nagios], and can be used just like any other
[Nagios exit code specifications], and can be used just like any other
plugin. Its advantage over other plugins is that it is small, fast, and has no
dependencies.

Expand All @@ -170,25 +170,25 @@ Getting Help
Feature requests, documentation requests, help installing and using, pull
requests, and other comments or questions are all always welcome. We strive to
provide expedient and detailed support for anyone using our software. Please
submit any requests via our [Github Issues Page] [issues], where someone will
submit any requests via our [Github Issues Page], where someone will
see it and get to work promptly.

License
=======
Copyright © 2015 Cisco Systems, Inc.

Licensed under the [Apache License, Version 2.0] [license] (the "License").
Licensed under the [Apache License, Version 2.0] (the "License").

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.


[1]: http://www.apache.org/licenses/LICENSE-2.0 "license"
[1]: http://www.apache.org/licenses/LICENSE-2.0 "Apache License, Version 2.0"
[2]: https://github.com/CiscoCloud/distributive/wiki "wiki"
[3]: https://github.com/CiscoCloud/distributive/issues "issues"
[3]: https://github.com/CiscoCloud/distributive/issues "Github Issues Page"
[4]: https://bintray.com/ciscocloud/rpm/Distributive/view#files "bintray"
[5]: https://www.consul.io/docs/agent/checks.html "Consul"
[6]: https://sensuapp.org/docs/0.18/checks "Sensu"
[7]: https://nagios-plugins.org/doc/guidelines.html#AEN78 "Nagios"
[7]: https://nagios-plugins.org/doc/guidelines.html#AEN78 "Nagios exit code specifications"
[8]: https://golang.org/doc/code.html#GOPATH "gopath"
[9]: https://github.com/pote/gpm "gpm"
[10]: https://github.com/pote/gvp "gvp"
Expand Down
2 changes: 1 addition & 1 deletion run.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
source build.sh
sudo ./bin/distributive -d "" -f samples/systemctl-fail.json --verbosity="debug"
sudo ./bin/distributive -d samples --verbosity="info"
8 changes: 4 additions & 4 deletions src/github.com/CiscoCloud/distributive/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,15 +271,15 @@ func runChecks(chklst Checklist) Checklist {
chklst.Codes = append(chklst.Codes, code)
chklst.Messages = append(chklst.Messages, msg)
// were errors encountered?
no := ""
passed := "failed"
if code == 0 {
no = " no"
passed = "passed"
}
// warn log happens later
log.WithFields(log.Fields{
"name": chk.Name,
"type": chk.Check,
}).Info("Check exited with" + no + " errors")
}).Info("Check " + passed)
}
return chklst
}
Expand Down Expand Up @@ -314,7 +314,7 @@ func main() {
log.WithFields(log.Fields{
"checklist": chklst.Name,
"report": report,
}).Warn("Some checks failed, printing checklist report")
}).Warn("Check(s) failed, printing checklist report")
} else {
log.WithFields(log.Fields{
"checklist": chklst.Name,
Expand Down
3 changes: 2 additions & 1 deletion src/github.com/CiscoCloud/distributive/workers/filesystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ func fileContains(parameters []string) (exitCode int, exitMessage string) {
if regex.Match(wrkutils.FileToBytes(path)) {
return 0, ""
}
return 1, "File does not match regexp:\n\tFile: " + path
msg := "File does not match regexp:\n\tFile: "
return 1, msg + path + "\n\tRegexp" + regex.String()
}

// permissions checks to see if a file's octal permissions match the given set
Expand Down

0 comments on commit 6733dc9

Please sign in to comment.