Documentation ¶
Index ¶
- func CheckHosts(config *Config, hostList []string) (map[string]*ConfigHost, error)
- func FileExists(file string) bool
- func FindConfigFile() string
- type ArpCache
- type Bandwidth
- type CommonApplications
- type Config
- type ConfigHost
- type CpuInfo
- type CpuIntensiveProcesses
- type CpuTemp
- type CpuUtilization
- type CronHistory
- type CurrentRam
- type DiskPartitions
- type DockerProcesses
- type DownloadTransferRate
- type EnabledServices
- type GeneralInfo
- type HostResponse
- type IoStats
- type ListeningPorts
- type LoadAvg
- type LoggedInUsers
- type Memcached
- type MemoryInfo
- type NeedsUpgrades
- type NetworkConnections
- type NetworkInterfaces
- type NetworkInterfacesAddress
- type NumberOfCpuCores
- type Pm2Stats
- type RamIntensiveProcesses
- type RecentAccountLogins
- type Redis
- type ScheduledCrons
- type Swap
- type UploadTransferRate
- type UserAccounts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckHosts ¶
func CheckHosts(config *Config, hostList []string) (map[string]*ConfigHost, error)
func FileExists ¶
func FindConfigFile ¶
func FindConfigFile() string
FindConfigFile will locate the a configuration file by looking at the following places and choosing the first: SATURN_CONFIG env variable, $PWD/config.toml, $PWD/config/config.toml, $HOME/.saturn/config.toml, and /etc/saturn/config.toml.
Types ¶
type CommonApplications ¶
type Config ¶
type Config struct { Core struct { Debug bool SpecialDebug bool TempDir string ModuleDir string RemoteBaseDir string KeepTempFiles bool HaltOnError bool } SSH struct { Username string Password string PrivateKey string Timeout string UseAgent bool } Hosts []*ConfigHost HostsMap map[string]*ConfigHost // contains filtered or unexported fields }
Config is a project-wide struct that holds configuration information
type ConfigHost ¶
type ConfigHost struct { Name string `json:"name"` Address string `json:"address"` Username string `json:"username"` Password string `json:"-"` PrivateKey string `json:"-"` Disable bool `json:"disabled"` SSHConnection *ssh.Client `json:"-"` SSHConfig *ssh.ClientConfig `json:"-"` // contains filtered or unexported fields }
func (*ConfigHost) ConnectSSH ¶
func (c *ConfigHost) ConnectSSH(clientConfig *ssh.ClientConfig) error
type CpuInfo ¶
type CpuInfo struct { Architecture string `json:"Architecture"` CPUOpModeS string `json:"CPU op-mode(s)"` ByteOrder string `json:"Byte Order"` CPUS string `json:"CPU(s)"` OnLineCPUSList string `json:"On-line CPU(s) list"` ThreadSPerCore string `json:"Thread(s) per core"` CoreSPerSocket string `json:"Core(s) per socket"` SocketS string `json:"Socket(s)"` NUMANodeS string `json:"NUMA node(s)"` VendorID string `json:"Vendor ID"` CPUFamily string `json:"CPU family"` Model string `json:"Model"` ModelName string `json:"Model name"` Stepping string `json:"Stepping"` CPUMHz string `json:"CPU MHz"` CPUMaxMHz string `json:"CPU max MHz"` CPUMinMHz string `json:"CPU min MHz"` BogoMIPS string `json:"BogoMIPS"` Virtualization string `json:"Virtualization"` L1dCache string `json:"L1d cache"` L1iCache string `json:"L1i cache"` L2Cache string `json:"L2 cache"` L3Cache string `json:"L3 cache"` NUMANode0CPUS string `json:"NUMA node0 CPU(s)"` Flags string `json:"Flags"` }
type CpuIntensiveProcesses ¶
type CpuUtilization ¶
type CpuUtilization struct {
Util int `json:"util"`
}
type CronHistory ¶
type CurrentRam ¶
type DiskPartitions ¶
type DockerProcesses ¶
type DownloadTransferRate ¶
type EnabledServices ¶
type EnabledServices struct {
Name string `json:"name"`
}
type GeneralInfo ¶
type GeneralInfo struct { Os string `json:"os"` OsVersion string `json:"os_version"` CurrentKernel string `json:"current_kernel"` LatestKernel string `json:"latest_kernel"` Hostname string `json:"hostname"` Uptime string `json:"uptime"` ServerTime string `json:"server_time"` Path string `json:"path"` Installed string `json:"installed"` }
type HostResponse ¶
type HostResponse struct { Host *ConfigHost `json:"host"` ArpCache []*ArpCache `json:"arp_cache,omitempty"` Bandwidth []*Bandwidth `json:"bandwidth,omitempty"` CommonApplications []*CommonApplications `json:"common_applications,omitempty"` CpuInfo *CpuInfo `json:"cpu_info,omitempty"` CpuIntensiveProcesses []*CpuIntensiveProcesses `json:"cpu_intensive_processes,omitempty"` CpuTemp *CpuTemp `json:"cpu_temp,omitempty"` CpuUtilization *CpuUtilization `json:"cpu_utilization,omitempty"` CronHistory []*CronHistory `json:"cron_history,omitempty"` CurrentRam *CurrentRam `json:"current_ram,omitempty"` DiskPartitions []*DiskPartitions `json:"disk_partitions,omitempty"` DockerProcesses []*DockerProcesses `json:"docker_processes,omitempty"` DownloadTransferRate []*DownloadTransferRate `json:"download_transfer_rate,omitempty"` EnabledServices []*EnabledServices `json:"enabled_services,omitempty"` GeneralInfo *GeneralInfo `json:"general_info,omitempty"` IoStats []*IoStats `json:"io_stats,omitempty"` ListeningPorts []*ListeningPorts `json:"listening_ports,omitempty"` LoadAvg *LoadAvg `json:"load_avg,omitempty"` LoggedInUsers []*LoggedInUsers `json:"logged_in_users,omitempty"` Memcached *Memcached `json:"memcached,omitempty"` MemoryInfo *MemoryInfo `json:"memory_info,omitempty"` NeedsUpgrades []*NeedsUpgrades `json:"needs_upgrades,omitempty"` NetworkConnections []*NetworkConnections `json:"network_connections,omitempty"` NetworkInterfaces []*NetworkInterfaces `json:"network_interfaces,omitempty"` NumberOfCpuCores *NumberOfCpuCores `json:"number_of_cpu_cores,omitempty"` Pm2Stats []*Pm2Stats `json:"pm2_stats,omitempty"` RamIntensiveProcesses []*RamIntensiveProcesses `json:"ram_intensive_processes,omitempty"` RecentAccountLogins []*RecentAccountLogins `json:"recent_account_logins,omitempty"` Redis *Redis `json:"redis,omitempty"` ScheduledCrons []*ScheduledCrons `json:"scheduled_crons,omitempty"` Swap []*Swap `json:"swap,omitempty"` UploadTransferRate []*UploadTransferRate `json:"upload_transfer_rate,omitempty"` UserAccounts []*UserAccounts `json:"user_accounts,omitempty"` }
func (*HostResponse) Print ¶
func (r *HostResponse) Print(short bool)
type ListeningPorts ¶
type LoggedInUsers ¶
type MemoryInfo ¶
type MemoryInfo struct { MemTotal string `json:"MemTotal"` MemFree string `json:"MemFree"` MemAvailable string `json:"MemAvailable"` Buffers string `json:"Buffers"` Cached string `json:"Cached"` SwapCached string `json:"SwapCached"` Active string `json:"Active"` Inactive string `json:"Inactive"` ActiveAnon string `json:"Active(anon)"` InactiveAnon string `json:"Inactive(anon)"` ActiveFile string `json:"Active(file)"` InactiveFile string `json:"Inactive(file)"` Unevictable string `json:"Unevictable"` Mlocked string `json:"Mlocked"` SwapTotal string `json:"SwapTotal"` SwapFree string `json:"SwapFree"` Dirty string `json:"Dirty"` Writeback string `json:"Writeback"` AnonPages string `json:"AnonPages"` Mapped string `json:"Mapped"` Shmem string `json:"Shmem"` Slab string `json:"Slab"` SReclaimable string `json:"SReclaimable"` SUnreclaim string `json:"SUnreclaim"` KernelStack string `json:"KernelStack"` PageTables string `json:"PageTables"` NFSUnstable string `json:"NFS_Unstable"` Bounce string `json:"Bounce"` WritebackTmp string `json:"WritebackTmp"` CommitLimit string `json:"CommitLimit"` CommittedAS string `json:"Committed_AS"` VmallocTotal string `json:"VmallocTotal"` VmallocUsed string `json:"VmallocUsed"` VmallocChunk string `json:"VmallocChunk"` HardwareCorrupted string `json:"HardwareCorrupted"` AnonHugePages string `json:"AnonHugePages"` CmaTotal string `json:"CmaTotal"` CmaFree string `json:"CmaFree"` HugePagesTotal string `json:"HugePages_Total"` HugePagesFree string `json:"HugePages_Free"` HugePagesRsvd string `json:"HugePages_Rsvd"` HugePagesSurp string `json:"HugePages_Surp"` Hugepagesize string `json:"Hugepagesize"` DirectMap4k string `json:"DirectMap4k"` DirectMap2M string `json:"DirectMap2M"` DirectMap1G string `json:"DirectMap1G"` }
type NeedsUpgrades ¶
type NetworkConnections ¶
type NetworkInterfaces ¶
type NetworkInterfaces struct { Interface string `json:"interface"` MacAddress string `json:"mac_address"` Ipv4 []*NetworkInterfacesAddress `json:"ipv4"` Ipv6 []*NetworkInterfacesAddress `json:"ipv6"` }
type NumberOfCpuCores ¶
type NumberOfCpuCores struct {
Cores int `json:"cores"`
}
type RamIntensiveProcesses ¶
type RecentAccountLogins ¶
type Redis ¶
type Redis struct { RedisVersion string `json:"redis_version"` ConnectedClients string `json:"connected_clients"` ConnectedSlaves string `json:"connected_slaves"` UsedMemoryHuman string `json:"used_memory_human"` TotalConnectionsReceived string `json:"total_connections_received"` TotalCommandsProcessed string `json:"total_commands_processed"` }
type ScheduledCrons ¶
type UploadTransferRate ¶
type UserAccounts ¶
Click to show internal directories.
Click to hide internal directories.