feat: add more checks
parent
d430a576b2
commit
c41b093f01
|
@ -1,11 +1,5 @@
|
|||
package check
|
||||
|
||||
const (
|
||||
Linux = "linux"
|
||||
Darwin = "darwin"
|
||||
Windows = "windows"
|
||||
)
|
||||
|
||||
var checks []Check
|
||||
|
||||
type Check interface {
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
//go:build !windows
|
||||
|
||||
package check
|
||||
|
||||
type databaseServerCheck struct{}
|
||||
|
||||
func NewDatabaseServerCheck() Check {
|
||||
return &databaseServerCheck{}
|
||||
}
|
||||
|
||||
func (s *databaseServerCheck) Name() string {
|
||||
return "database-server"
|
||||
}
|
||||
|
||||
func (s *databaseServerCheck) Paths() []string {
|
||||
return []string{
|
||||
"/var/log/mysqld.log",
|
||||
"/var/log/mysql.log",
|
||||
}
|
||||
}
|
||||
|
||||
func init() {
|
||||
AddCheck(NewDatabaseServerCheck())
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
//go:build !windows
|
||||
|
||||
package check
|
||||
|
||||
type ftpCheck struct{}
|
||||
|
||||
func NewFTPCheck() Check {
|
||||
return &ftpCheck{}
|
||||
}
|
||||
|
||||
func (s *ftpCheck) Name() string {
|
||||
return "ftp"
|
||||
}
|
||||
|
||||
func (s *ftpCheck) Paths() []string {
|
||||
return []string{
|
||||
"/usr/local/psa/var/log/xferlog*",
|
||||
"/var/log/xferlog*",
|
||||
"/var/log/secure*",
|
||||
"/var/log/pureftp.log*",
|
||||
}
|
||||
}
|
||||
|
||||
func init() {
|
||||
AddCheck(NewFTPCheck())
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
//go:build !windows
|
||||
|
||||
package check
|
||||
|
||||
type httpServerCheck struct{}
|
||||
|
||||
func NewHTTPServerCheck() Check {
|
||||
return &httpServerCheck{}
|
||||
}
|
||||
|
||||
func (s *httpServerCheck) Name() string {
|
||||
return "http-server"
|
||||
}
|
||||
|
||||
func (s *httpServerCheck) Paths() []string {
|
||||
return []string{
|
||||
"/var/log/apache2/access.log*",
|
||||
"/var/log/apache2/error_log*",
|
||||
"/var/log/httpd*",
|
||||
"/var/log/apache/access.log*",
|
||||
"/var/log/apache/error.log*",
|
||||
"/var/log/nginx/*.log*",
|
||||
}
|
||||
}
|
||||
|
||||
func init() {
|
||||
AddCheck(NewHTTPServerCheck())
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
//go:build !windows
|
||||
|
||||
package check
|
||||
|
||||
type lastLogCheck struct{}
|
||||
|
||||
func NewLastLogCheck() Check {
|
||||
return &lastLogCheck{}
|
||||
}
|
||||
|
||||
func (s *lastLogCheck) Name() string {
|
||||
return "lastlog"
|
||||
}
|
||||
|
||||
func (s *lastLogCheck) Paths() []string {
|
||||
return []string{
|
||||
"/var/log/lastlog",
|
||||
}
|
||||
}
|
||||
|
||||
func init() {
|
||||
AddCheck(NewLastLogCheck())
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
//go:build !windows
|
||||
|
||||
package check
|
||||
|
||||
type mailCheck struct{}
|
||||
|
||||
func NewMailCheck() Check {
|
||||
return &mailCheck{}
|
||||
}
|
||||
|
||||
func (s *mailCheck) Name() string {
|
||||
return "mail"
|
||||
}
|
||||
|
||||
func (s *mailCheck) Paths() []string {
|
||||
return []string{
|
||||
"/usr/local/psa/var/log/maillog*",
|
||||
"/var/log/maillog*",
|
||||
}
|
||||
}
|
||||
|
||||
func init() {
|
||||
AddCheck(NewMailCheck())
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
//go:build !windows
|
||||
|
||||
package check
|
||||
|
||||
type systemCheck struct{}
|
||||
|
||||
func NewSystemCheck() Check {
|
||||
return &systemCheck{}
|
||||
}
|
||||
|
||||
func (s *systemCheck) Name() string {
|
||||
return "system"
|
||||
}
|
||||
|
||||
func (s *systemCheck) Paths() []string {
|
||||
return []string{
|
||||
"/var/log/lastlog",
|
||||
"/var/log/boot.log*",
|
||||
"/var/log/auth.log*",
|
||||
"/var/log/daemon.log*",
|
||||
"/var/log/kern.log*",
|
||||
"/var/log/boot.log*",
|
||||
"/var/log/syslog*",
|
||||
"/var/log/mail.log*",
|
||||
"/var/log/messages*",
|
||||
"/var/log/secure*",
|
||||
"/var/log/btmp*",
|
||||
"/var/log/utmp*",
|
||||
"/var/log/wtmp*",
|
||||
"/var/log/faillog",
|
||||
"/var/log/audit/*.log*",
|
||||
"/var/log/dmesg",
|
||||
}
|
||||
}
|
||||
|
||||
func init() {
|
||||
AddCheck(NewSystemCheck())
|
||||
}
|
Loading…
Reference in New Issue