Documentation
¶
Index ¶
Constants ¶
View Source
const ( //Online The service is online Online = "ONLINE" // Pending The service is potentially offline, and will be marked so after meeting the Config.FailedCheckThreshold Pending = "PENDING" // Offline The service is offline Offline = "OFFLINE" )
Variables ¶
View Source
var ( // CurrentServices The currently monitored services CurrentServices []Service )
View Source
var Database *sqlx.DB
Database The sqlite3 database
View Source
var (
RandomString string
)
Functions ¶
func Connect ¶
func Connect()
Connect Connects to the sqlite3 database, and creates the database if it does not already exist
func LoadServices ¶
func LoadServices()
LoadServices Loads all the services into CurrentServices and sets defaults
func RandAuthToken ¶
func RandAuthToken() string
Types ¶
type CheckLog ¶
type CheckLog struct { ID int `db:"id" json:"id"` LogTime string `db:"logtime" json:"logtime"` Status string `db:"status" json:"status"` }
func (*CheckLog) MarshalJSON2 ¶
type Config ¶
type Config struct { Verbose bool `json:"verbose"` WebUIHost string `json:"web_ui_host"` WebUIPort int `json:"web_ui_port"` CheckInterval int `json:"check_interval"` PendingOfflineCheckInterval int `json:"pending_offline_check_interval"` MaxConcurrentChecks int `json:"max_concurrent_checks"` ConnectionTimeout int `json:"connection_timeout"` SuccessfulHTTPStatusCodes []int `json:"successful_http_status_codes"` IgnoreHTTPSCertErrors bool `json:"ignore_https_cert_errors"` FailedCheckThreshold int `json:"failed_check_threshold"` SendEmail bool `json:"send_email"` EmailRecipients []string `json:"email_recipients"` SMTPHost string `json:"smtp_host"` SMTPPort int `json:"smtp_port"` SMTPEmailAddress string `json:"smtp_email_address"` SMTPUsername string `json:"smtp_username"` SMTPPassword string `json:"smtp_password"` SMTPAuth bool `json:"smtp_auth"` SendSMS bool `json:"send_sms"` SMSRecipients []string `json:"sms_recipients"` TwilioAccountSID string `json:"twilio_account_sid"` TwilioAuthToken string `json:"twilio_auth_token"` TwilioPhoneNumber string `json:"twilio_phone_number"` ConfigPassword string `json:"config_password"` ArchiveDay int `json:"archive_day"` UserName string `json:"user_name"` UserPassword string `json:"user_password"` }
Config The application configuration and settings
var ( // CurrentConfig The current configuration CurrentConfig Config )
type Service ¶
type Service struct { ID int `db:"id" json:"id"` Name string `db:"name" json:"name"` Protocol string `db:"protocol" json:"protocol"` Host string `db:"host" json:"host"` Port jsonNullInt64 `db:"port" json:"port"` Grp string `db:"grp" json:"grp"` Emails string `db:"emails" json:"emails"` UptimeStart int64 `json:"uptime_start"` Status string `json:"status"` FailureCount int `json:"failure_count"` FailtimeStart int64 `json:"failtime_start"` Enabled int `json:"enabled"` }
Service Represents a service that is being monitored
func (*Service) CheckService ¶
CheckService Checks whether a service is online or offline
func (*Service) MarshalJSON2 ¶
Click to show internal directories.
Click to hide internal directories.