scheduled_task

package
v0.29.0-rc.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Rendered for windows/amd64

Index

Constants

View Source
const Name = "scheduled_task"
View Source
const SCHEDULED_TASK_PROGRAM_ID = "Schedule.Service.1"
View Source
const S_FALSE = 0x00000001

S_FALSE is returned by CoInitialize if it was already called on this thread.

Variables

View Source
var ConfigDefaults = Config{
	TaskExclude: types.RegExpEmpty,
	TaskInclude: types.RegExpAny,
}
View Source
var TASK_STATES = []string{"disabled", "queued", "ready", "running", "unknown"}

Functions

This section is empty.

Types

type Collector added in v0.27.0

type Collector struct {
	// contains filtered or unexported fields
}

func New

func New(config *Config) *Collector

func NewWithFlags

func NewWithFlags(app *kingpin.Application) *Collector

func (*Collector) Build added in v0.27.0

func (c *Collector) Build(_ *slog.Logger, _ *wmi.Client) error

func (*Collector) Close added in v0.27.0

func (c *Collector) Close(_ *slog.Logger) error

func (*Collector) Collect added in v0.27.0

func (c *Collector) Collect(_ *types.ScrapeContext, logger *slog.Logger, ch chan<- prometheus.Metric) error

func (*Collector) GetName added in v0.27.0

func (c *Collector) GetName() string

func (*Collector) GetPerfCounter added in v0.27.0

func (c *Collector) GetPerfCounter(_ *slog.Logger) ([]string, error)

type Config

type Config struct {
	TaskExclude *regexp.Regexp `yaml:"task_exclude"`
	TaskInclude *regexp.Regexp `yaml:"task_include"`
}

type ScheduledTask

type ScheduledTask struct {
	Name            string
	Path            string
	Enabled         bool
	State           TaskState
	MissedRunsCount float64
	LastTaskResult  TaskResult
}

type ScheduledTasks

type ScheduledTasks []ScheduledTask

type TaskResult

type TaskResult uint
const (
	SCHED_S_SUCCESS          TaskResult = 0x0
	SCHED_S_TASK_HAS_NOT_RUN TaskResult = 0x00041303
)

type TaskState

type TaskState uint

TaskState ... https://docs.microsoft.com/en-us/windows/desktop/api/taskschd/ne-taskschd-task_state

const (
	TASK_STATE_UNKNOWN TaskState = iota
	TASK_STATE_DISABLED
	TASK_STATE_QUEUED
	TASK_STATE_READY
	TASK_STATE_RUNNING
)

func (TaskState) String

func (t TaskState) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL