sqrl

package module
v0.0.0-...-e38daba Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2016 License: MIT Imports: 15 Imported by: 0

README

sqrl

Overview

A system inventory program created by HPC academy students designed to gather extensive system information.

This program monitors RAM, OS, CPU, HDD, swap, and network information across systems, logging the information periodically.

  • Logs amount of free, total, and used RAM.
  • Logs amount of free, total, and used Swap.
  • Logs hostname, version, and kernel information.
  • Logs CPU, number of cores, speed of CPU, and Model of CPU.
  • Logs names, addresses, flags, and speeds of networks.

Basic Contents

  • 'main.go'
  • 'README.md'

Getting Started

If you have a working Go environment on your computer, you can pull down this repo using:

> go get github.com/dmmcquay/sqrl

Usage

sqrl

Running 'sqrl [mode][optional flag]' will log various system information.

The mode options are:

  • sqrl cpu
  • sqrl hdd
  • sqrl net
  • sqrl ros
  • sqrl all

Here is an example:

sqrl all 

This will log all system information. Using specifc modes will only log that particular information.

You can also output the logged information to the screen using the -v flag.

sqrl all -v

#Authors:

  • Delaney Gill-Sommerhauser
  • Danielle Larson
  • Christopher Moussa

Acknowledgements

  • Derek McQuay
  • github.com/shirou/gopsutil
  • github.com/dustin/go-humanize
  • github.com/likexian/host-stat-go
  • github.com/spf13/cobra

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRoutes

func AddRoutes(sm *http.ServeMux)

func RamOSInfo

func RamOSInfo() (Ram, OS, Swap, error)

Types

type CPUInfo

type CPUInfo struct {
	CPU   int    `json:"cpu"`
	Cores int32  `json:"cores"`
	Speed string `json:"speed"`
	Model string `json:"model"`
}

func GetCPUInfo

func GetCPUInfo() (CPUInfo, error)

func (*CPUInfo) LogWriter

func (c *CPUInfo) LogWriter()

func (CPUInfo) String

func (c CPUInfo) String() string

type Interface

type Interface struct {
	Name  string              `json:"name"`
	Addrs []net.InterfaceAddr `json:"addrs"` // IP Address, MAC Address and their respective ports
	Flags []string            `json:"flags"` // Types of links (up, down, multicast, etc.)
	Speed string              `json:"speed"`
}

type Interfaces

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

func GetInterfaces

func GetInterfaces() (Interfaces, error)

func (*Interfaces) LogWriter

func (i *Interfaces) LogWriter()

func (Interfaces) String

func (i Interfaces) String() string

type OS

type OS struct {
	Hostname string `json:"hostname"`
	Kernel   string `json:"kernel"`
	Version  string `json:"version"`
}

func (*OS) LogWriter

func (o *OS) LogWriter()

func (OS) String

func (o OS) String() string

type Ram

type Ram struct {
	Total string `json:"total"`
	Free  string `json:"free"`
	Used  string `json:"used"`
}

func (*Ram) LogWriter

func (r *Ram) LogWriter()

func (Ram) String

func (r Ram) String() string

type Report

type Report struct {
	Ram     `json:"Ram"`
	Swap    `json:"Swap"`
	OS      `json:"OS"`
	CPUInfo `json:"CPUInfo"`
	Inter   Interfaces `json:"Interfaces"`
}

func MakeReport

func MakeReport() (Report, error)

func (*Report) LogWriter

func (r *Report) LogWriter()

func (Report) String

func (r Report) String() string

type Swap

type Swap struct {
	Total string `json:"total"`
	Free  string `json:"free"`
	Used  string `json:"used"`
}

func (*Swap) LogWriter

func (s *Swap) LogWriter()

func (Swap) String

func (s Swap) String() string

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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