Documentation ¶
Index ¶
- func DoGet(url string) (string, bool)
- func StatusOf(itemName string, allStat []ItemStatus) (rv string)
- type ConfigItem
- type ConfigMonitor
- type Countries
- type ItemStatus
- type MonIt
- func (mon *MonIt) AddNewItem(itemName string, ttl uint64)
- func (mon *MonIt) ChangeConfigOnItem(itemName string, newConfig map[string]interface{})
- func (mon *MonIt) GetAllItem() (rv []string)
- func (mon *MonIt) GetConfig() (s string)
- func (mon *MonIt) GetItemStatus() (rv []ItemStatus)
- func (mon *MonIt) GetListOfPotentialItem() (rv []string)
- func (mon *MonIt) GetNotifyItem() (rv []string)
- func (mon *MonIt) GetStatusOfItemVerbose(extra bool) (rv []ItemStatus, hasChanged bool)
- func (mon *MonIt) IsMonitoredItem(itemKey string) bool
- func (mon *MonIt) RemoveItem(itemName string)
- func (mon *MonIt) SendIAmAlive(itemName string, myStatus map[string]interface{})
- func (mon *MonIt) SendIAmShutdown(itemName string)
- func (mon *MonIt) SendIFailed(itemName string)
- func (mon *MonIt) SendPeriodicIAmAlive(itemName string)
- func (mon *MonIt) SendTrxState(state, trxId string)
- func (mon *MonIt) SetConfig(s string)
- func (mon *MonIt) SetConfigFromFile(fn string)
- func (mon *MonIt) SetDebugFlags(db map[string]bool)
- func (mon *MonIt) SetupStatus(listenAt string, fxStatus func() string, fxTest func() bool)
- func (mon *MonIt) SortByNameStatus(st Countries)
- func (mon *MonIt) UpdateConfig() (rv ConfigMonitor)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StatusOf ¶
func StatusOf(itemName string, allStat []ItemStatus) (rv string)
Types ¶
type ConfigItem ¶
type ConfigItem struct { Name string `json:"Name"` // Extended name for this item TTL uint64 `json:"TTL"` // How long before should have received PING on item RequiresPing bool `json:"RequiresPing"` // To determine if it is alive requires a "ping" -- Maybe keep track of delta-t on last ping and only so often PingUrl string `json:"PingUrl"` // URL to do "get" on to ping item -- http://localhost:16040/api/status for example Group []string `json:"Group"` // Set of groups that this belongs to "host":"virtual-host", "host":"goftl-server" CdTo string `json:"CdTo"` // Direcotry to chagne to before run CmdToRun string `json:"CmdToRun"` // Command to run when notification is needed. NotifThreshold int `json:"NotifThreshold"` // new: Number of misssed events before Notification. Say 4. RemediateThreshold int `json:"RemediateThreshold"` // new: Number of misseed before remediation is run. Say 3. RemediateCdTo string `json:"RemediateCdTo"` // new: Direcotry to chagne to before run RemediateCmdToRun string `json:"RemediateCmdToRun"` // new: Command to run when remediateion is needed. Extra map[string]interface{} // Other Config Items... // contains filtered or unexported fields }
type ConfigMonitor ¶
type ConfigMonitor struct { Item map[string]ConfigItem // MinTTL int // Defaults to 30 seconds - shortest time that can be set in seconds TrxIdTTL int // 0 for forever, else length in seconds for Trx:Id tracing to last on an Trx:Id }
type Countries ¶
type Countries []ItemStatus
type MonIt ¶
type MonIt struct { GetConn func() (conn *redis.Client) FreeConn func(conn *redis.Client) // contains filtered or unexported fields }
func (*MonIt) AddNewItem ¶
add an item to the set of items that is monitored URL: /api/mon/add-new-item?itemName= ttl= ...
func (*MonIt) ChangeConfigOnItem ¶
URL: /api/mon/upd-config-item?itemName=, ...
func (*MonIt) GetAllItem ¶
return the set of all the named items that are being monitored URL: /api/mon/get-all-item
func (*MonIt) GetItemStatus ¶
func (mon *MonIt) GetItemStatus() (rv []ItemStatus)
GetItemStatus - up/down - all items monitored. URL: /api/mon/item-status
func (*MonIt) GetListOfPotentialItem ¶
get to set of "could-be-monitored-items" URL: /api/mon/list-potential
func (*MonIt) GetNotifyItem ¶
GetNotifyItem returns the set of items that is NOT running that should be running Eventually - check via circuit checs for items that require ping URL: /api/mon/get-notify-item
func (*MonIt) GetStatusOfItemVerbose ¶
func (mon *MonIt) GetStatusOfItemVerbose(extra bool) (rv []ItemStatus, hasChanged bool)
GetStatusOfItemVerbose returns the set of items that is NOT running that should be running Eventually - check via circuit checs for items that require ping URL: /api/mon/get-notify-item This will return a sorted by name array and true iff the name/status in the array has changed since last time.
func (*MonIt) IsMonitoredItem ¶
New: Sun Jul 16 06:15:11 MDT 2017
func (*MonIt) RemoveItem ¶
URL: /api/mon/rem-item?itemName=
func (*MonIt) SendIAmAlive ¶
Note that a particualr resources is up and sending "alive" pings.
func (*MonIt) SendIAmShutdown ¶
shutdown op -- intentionally shutdown - means no notificaiton
func (*MonIt) SendIFailed ¶
shutdown op -- I know that I have failed - I should be up but I have AbEnded
func (*MonIt) SendPeriodicIAmAlive ¶
Create a timed I Am Alive message
func (*MonIt) SendTrxState ¶
/api/mon/trx?state=on|off trx:state (on|off)
Turn tracking on/off for this Trx-ID - if via SIO - then sends message via Pub/Sub to all servers to turn this ID on. If via /api/mon/trx then if via /api/mon/trx - then sends Pub/Sub to tracer - to tell tracter to send message to pass on.
func (*MonIt) SetConfigFromFile ¶
set config from file URL: /api/mon/reload-config?fn=
func (*MonIt) SetDebugFlags ¶ added in v0.5.5
func (*MonIt) SetupStatus ¶
HTTP server that handles /api/status with an I AM ALIVE message.
func (*MonIt) SortByNameStatus ¶
cc.mon.SortByNameStatus(&st)
func (*MonIt) UpdateConfig ¶
func (mon *MonIt) UpdateConfig() (rv ConfigMonitor)
Pull current configuraiton from Redis - Allows for changes in config to take place after program starts running.