fix: default value is -1 for critical and warning options

This commit is contained in:
Adrien Waksberg 2019-06-27 11:34:02 +02:00 committed by Adrien Waksberg
parent ab6f301467
commit 0cee7e7d37

View file

@ -18,8 +18,8 @@ var (
PASSWORD = flag.String("password", "", "mysql password")
DATABASE = flag.String("database", "", "mysql database")
QUERY = flag.String("query", "", "mysql query")
WARNING = flag.Int("warning", 0, "limit to return a warning alert")
CRITICAL = flag.Int("critical", 0, "limit to return a critical alert")
WARNING = flag.Int("warning", -1, "limit to return a warning alert")
CRITICAL = flag.Int("critical", -1, "limit to return a critical alert")
)
func init() {
@ -34,7 +34,7 @@ func init() {
Critical("Please set query option")
}
if *WARNING == 0 || *CRITICAL == 0 {
if *WARNING == -1 || *CRITICAL == -1 {
Critical("Please set warning and critical options")
}
}