diff options
author | Julien Dessaux | 2021-04-23 16:51:22 +0200 |
---|---|---|
committer | Julien Dessaux | 2021-04-23 16:51:22 +0200 |
commit | 38d9c881b3b5ece91f428c87f0b7bb9efb3e88a8 (patch) | |
tree | d3f7167fae6388f4db35a63e660d1816c9c2943e /zabbix/statefile.go | |
parent | Fixed wrongfully hardcoded path in tests. (diff) | |
download | bareos-zabbix-check-38d9c881b3b5ece91f428c87f0b7bb9efb3e88a8.tar.gz bareos-zabbix-check-38d9c881b3b5ece91f428c87f0b7bb9efb3e88a8.tar.bz2 bareos-zabbix-check-38d9c881b3b5ece91f428c87f0b7bb9efb3e88a8.zip |
Updated for go 1.16 modules1.2
Diffstat (limited to 'zabbix/statefile.go')
-rw-r--r-- | zabbix/statefile.go | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/zabbix/statefile.go b/zabbix/statefile.go deleted file mode 100644 index 26ea650..0000000 --- a/zabbix/statefile.go +++ /dev/null @@ -1,34 +0,0 @@ -package zabbix - -import ( - "fmt" - "os" - "path/filepath" -) - -const ( - bareosStateFile = "bareos-fd.9102.state" - baculaStateFile = "bacula-fd.9102.state" -) - -func checkStateFile() error { - // Finds the state file to parse - if stateFileName != "" { - stateFileName = filepath.Join(workDir, stateFileName) - info, err := os.Stat(stateFileName) - if os.IsNotExist(err) || info.IsDir() { - return fmt.Errorf("The state file %s does not exist", stateFileName) - } - } else { - stateFileName = filepath.Join(workDir, bareosStateFile) - info, err := os.Stat(stateFileName) - if os.IsNotExist(err) || info.IsDir() { - stateFileName = filepath.Join(workDir, baculaStateFile) - info, err = os.Stat(stateFileName) - if os.IsNotExist(err) || info.IsDir() { - return fmt.Errorf("Could not find a suitable state file. Has a job ever run?") - } - } - } - return nil -} |