Todd¶
Todd is a repository of scripts used to gather data for Lockstep Analytics. Installation and management of these scripts is facilitated by the Dirk module.
Installation¶
Install-Module Dirk
Import-Module Dirk
Install-Dirk -Path 'c:\lockstep' -GithubCredential (Get-Credential)
The above command will install Dirk to c:\lockstep
, prompting for credentials. Optionally you can supply -Branch
to install a specific branch during development.
Install-Dirk -Path 'c:\lockstep' -GithubCredential (Get-Credential) -Branch 'MyTestBranch'
Installation¶
The root directory for the Todd (C:\lockstep\Todd
in the example above) requires a config.json file. This will be loaded into Todd as $ToddConfig
to be used by all subsequent scripts. The file is a json file with the following available settings.
Setting | IsRequired | Type | Requires | Description |
---|---|---|---|---|
SyslogServer | no | string | SyslogPort SyslogApplication | fqdn/ip of the desired syslog server |
SyslogPort | no | int | SyslogServer SyslogApplication | udp port for desired syslog server |
SyslogApplication | no | string | SyslogServer SyslogPort | application identifier to use for syslog messages |
LogDnaApiKey | no | int | SyslogApplication LogDnaEnviroment | apikey for logdna messages |
LogDnaEnvironment | no | int | SyslogApplication LogDnaApiKey | enviroment identifier to use for logdna messages (set this to the shortname of the customer) |
LogThreshold | no | int | verbosity level for logging (higher is more verbose) | |
MaxLogFiles | no | int | number of local log files to keep before rolling them | |
AesKey | yes | array | byte array used to encrypt senstive configuration info, created with New-EncryptionKey from CorkScrew PowerShell module |
Scheduled Task Setup¶
The Dirk comes with a handy cmdlet (Register-DirkScheduledTask) for setting up scheduled tasks to run Todd. It currently supports the following schedules.
- Daily
- Hourly
- Every 5 Minutes
Optionally you can supply an arbitrary -JobName
parameter which is passed to Todd on runtime and used to determine what checks should run. More info on this at Inputs. You must provide a credential to run the scheduled task.
Import-Module Dirk
# Daily Task with job name of everyday
$TaskCred = Get-Credential
Register-DirkScheduledTask -Daily -JobName everyday -ScheduledTaskCredential $TaskCred
# Hourly Task with job name of onthehour
$TaskCred = Get-Credential
Register-DirkScheduledTask -Hourly -JobName onthehour -ScheduledTaskCredential $TaskCred
# Every 5 minutes task with name of allthetime
$TaskCred = Get-Credential
Register-DirkScheduledTask -Every5Minutes -JobName allthetime -ScheduledTaskCredential $TaskCred
If you need some other schedule, you can still use this cmdlet, just update the schedule as needed.