Documentation ¶
Index ¶
- Variables
- func ByteCountIEC(b int64) string
- func ByteCountSI(b int64) string
- func GetNNFromDeviceName(name string) (int, error)
- func GetNNFromSiteName(name string) (int, error)
- func GetNNFromUISPDevice(d *models.DeviceStatusOverview) (int, error)
- func VersionString() string
- type App
- func (a *App) ConsoleWriteObject(obj string) error
- func (a *App) GetFullOutageMap(ctx context.Context) (OutageMap, error)
- func (a *App) MeshAPIDevices(ids ...string) (map[int]*meshapi.Device, error)
- func (a *App) MeshAPIKML() ([]byte, error)
- func (a *App) MeshAPINodes(ids ...string) (map[int]meshapi.Node, error)
- func (a *App) RunDaemon(daemonCtx context.Context) (errs []error)
- func (a *App) Tableify(headers []string, data [][]string) error
- func (a *App) UISPDevices() ([]*models.DeviceStatusOverview, error)
- func (a *App) WatchLogs(ctx context.Context, since time.Time, dstCh chan<- LogEvent) error
- type Config
- type CoreConfig
- type DaemonConfig
- type FusedDevice
- type HealthStatus
- type LogEvent
- type LogEventUISP
- type Outage
- type OutageMap
- type OutageUISP
- type SlackConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // TODO: make this mapping dynamic DefaultMonitoringChannel = "CSJK7P7C3" // #monitoring-unms NNToSlackChannel = map[int]string{ 5712: "C02HZLLH85R", } )
Functions ¶
func ByteCountIEC ¶ added in v0.2.1
func ByteCountSI ¶ added in v0.2.1
func GetNNFromDeviceName ¶ added in v0.4.0
TODO: write unit tests for this function TODO: make this use other device fields (model?) to help identify
func GetNNFromSiteName ¶ added in v0.4.0
typically the UISP name for our sites follows a convention like "Prospect Heights - 3461"
func GetNNFromUISPDevice ¶ added in v0.4.0
func GetNNFromUISPDevice(d *models.DeviceStatusOverview) (int, error)
func VersionString ¶ added in v0.3.0
func VersionString() string
Types ¶
type App ¶
type App struct { *client.UISPAPI Slack *slack.Client MeshAPIClient *meshapi.Client // contains filtered or unexported fields }
func (*App) ConsoleWriteObject ¶
func (*App) GetFullOutageMap ¶ added in v0.5.0
func (*App) MeshAPIDevices ¶ added in v0.2.2
func (*App) MeshAPIKML ¶ added in v0.3.2
func (*App) MeshAPINodes ¶ added in v0.3.0
func (*App) UISPDevices ¶ added in v0.2.2
func (a *App) UISPDevices() ([]*models.DeviceStatusOverview, error)
type Config ¶ added in v0.4.1
type Config struct { Core CoreConfig `json:"core"` Slack SlackConfig `json:"slack"` Daemon DaemonConfig `json:"daemon"` }
type CoreConfig ¶ added in v0.4.1
type CoreConfig struct {
OutputFormat string `json:"format"`
}
type DaemonConfig ¶ added in v0.4.1
type DaemonConfig struct { DFSEventDetection bool `json:"dfs-event-detection"` OutageDetection bool `json:"outage-detection"` EnableSlack bool `json:"enable-slack"` }
DaemonConfig contains relevant configuration for the daemon's behavior.
type FusedDevice ¶ added in v0.2.2
type HealthStatus ¶ added in v0.5.0
type HealthStatus string
const ( HealthStatusOnline HealthStatus = "online" HealthStatusUnreachable HealthStatus = "unreachable" HealthStatusDegraded HealthStatus = "degraded" HealthStatusOffline HealthStatus = "offline" HealthStatusUnknown HealthStatus = "unknown" )
type LogEventUISP ¶ added in v0.4.0
TODO: we should patch the UISP swagger spec to rename Model9 to something more useful here
type Outage ¶ added in v0.5.0
type Outage struct { NN int OutageUISP HealthStatus Start time.Time }
type OutageMap ¶ added in v0.5.0
type OutageMap struct {
// contains filtered or unexported fields
}
func (*OutageMap) GetOutagesDeviceNamesByOutageType ¶ added in v0.5.0
func (*OutageMap) ImpactedNNs ¶ added in v0.5.0
func (*OutageMap) NodeDeviceOutages ¶ added in v0.5.0
type OutageUISP ¶ added in v0.5.0
type SlackConfig ¶ added in v0.4.1
type SlackConfig struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.