Giter VIP home page Giter VIP logo

saido's People

Contributors

derhnyel avatar deven96 avatar mensaah avatar nurudeen38 avatar silvareal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

saido's Issues

SSH pasword login

Currently, only using a keyfile is allowed by saido for ssh. We also have to make config provision for when the ssh is made via a pasword only and no keyfile

CLI package

CLI package for processing subcommands and arguments. Cobra can be used in this case

We should be able to do things like
yaad run , yaad run -f remote.yml

Drivers

Drivers fulfill the driver interface and define consistent ways to be able to connect to instances and execute commands to obtain metrics.

Some rudimentary Driver suggestions are

  • Local Nix(current nix system)
  • Local Windows (current windows system)
  • SSH Nix(remote system that is SSH'd into) Goph
  • Heroku (heroku instance?)

YAML parsing

Create utility or package for parsing yaml files and getting the appropriate arguments to retrieve host metrics

Increase Documentation Coverage

  • Document Inspectors rather than just leaving an example config file?
  • Also fix readme for starting in dev mode on supported platforms
  • Create Demo video that shows from start to finish how to download the binary for a specific platform, cat a config file that has local, ssh-password, ssh-file logins and has individual metrics

Ci/CD Processes

  • Run unit tests
  • Release binaries via goreleaser
  • Test against windows server ssh?

Example jsons for Linux

  • Docker
{
   "Error":false,
   "Message":{
      "Host":"localhost",
      "Name":"docker",
      "Platform":"Linux",
      "Data":[
         {
            "CPU":11.29,
            "ContainerID":"0a993a28a444",
            "ContainerName":"saido-linux-sshserver",
            "Limit":15749.12,
            "MemPercent":0.08,
            "MemUsage":12.32,
            "Pid":30
         }
      ]
   }
}
  • Memory
{
   "Error":false,
   "Message":{
      "Host":"localhost",
      "Name":"memory",
      "Platform":"Linux",
      "Data":{
         "Cached":3595.96484375,
         "MemFree":8833.71875,
         "MemTotal":15745.2421875,
         "SwapFree":2047.99609375,
         "SwapTotal":2047.99609375
      }
   }
}
  • Disk
{
   "Error":false,
   "Message":{
      "Host":"localhost",
      "Name":"disk",
      "Platform":"Linux",
      "Data":[
         {
            "Available":0,
            "FileSystem":"sysfs",
            "PercentFull":0,
            "Size":0,
            "Used":0,
            "VolumeName":""
         },
         {
            "Available":0,
            "FileSystem":"proc",
            "PercentFull":0,
            "Size":0,
            "Used":0,
            "VolumeName":""
         },
         {
            "Available":7835.03515625,
            "FileSystem":"udev",
            "PercentFull":0,
            "Size":7835.03515625,
            "Used":0,
            "VolumeName":""
         },
         {
            "Available":0,
            "FileSystem":"devpts",
            "PercentFull":0,
            "Size":0,
            "Used":0,
            "VolumeName":""
         },
         {
            "Available":1572.25390625,
            "FileSystem":"tmpfs",
            "PercentFull":1,
            "Size":1574.52734375,
            "Used":2.2734375,
            "VolumeName":""
         },
         {
            "Available":44444.79296875,
            "FileSystem":"/dev/nvme0n1p7",
            "PercentFull":76,
            "Size":187399.83984375,
            "Used":133364.5,
            "VolumeName":""
         },
         {
            "Available":0,
            "FileSystem":"securityfs",
            "PercentFull":0,
            "Size":0,
            "Used":0,
            "VolumeName":""
         },
         {
            "Available":7813.92578125,
            "FileSystem":"tmpfs",
            "PercentFull":1,
            "Size":7872.62109375,
            "Used":58.6953125,
            "VolumeName":""
         },
         {
            "Available":4.99609375,
            "FileSystem":"tmpfs",
            "PercentFull":1,
            "Size":5,
            "Used":0.00390625,
            "VolumeName":""
         },
         {
            "Available":7872.62109375,
            "FileSystem":"tmpfs",
            "PercentFull":0,
            "Size":7872.62109375,
            "Used":0,
            "VolumeName":""
         }
      ]
   }
}
  • Tcp
{
   "Error":false,
   "Message":{
      "Host":"localhost",
      "Name":"tcp",
      "Platform":"Linux",
      "Data":{
         "Ports":{
            "2222":"ESTAB",
            "33518":"CLOSE-WAIT",
            "52370":"CLOSE-WAIT",
            "53556":"ESTAB",
            "55832":"ESTAB",
            "56661":"FIN-WAIT-2",
            "57848":"CLOSE-WAIT",
         }
      }
   }
}
  • Custom : "echo Hello!!!"
{
   "Error":false,
   "Message":{
      "Host":"0.0.0.0",
      "Name":"custom",
      "Platform":"Linux",
      "Data":{
         "Output":"Hello!!!\n"
      }
   }
}
  • LoadAvg
{
   "Error":false,
   "Message":{
      "Host":"localhost",
      "Name":"loadavg",
      "Platform":"Linux",
      "Data":{
         "Load15M":0.77,
         "Load1M":0.94,
         "Load5M":1
      }
   }
}
  • Process
{
   "Error":false,
   "Message":{
      "Host":"localhost",
      "Name":"process",
      "Platform":"Linux",
      "Data":[
         {
            "CPU":0,
            "Command":"/sbin/init splash",
            "Memory":0,
            "Pid":0,
            "TTY":"?",
            "Time":1,
            "User":"root"
         },
         {
            "CPU":0,
            "Command":"[kthreadd]",
            "Memory":0,
            "Pid":0,
            "TTY":"?",
            "Time":0,
            "User":"root"
         },
         {
            "CPU":0,
            "Command":"[irq/124-pciehp]",
            "Memory":0,
            "Pid":0,
            "TTY":"?",
            "Time":0,
            "User":"root"
         },
         {
            "CPU":0,
            "Command":"[acpi_thermal_pm]",
            "Memory":0,
            "Pid":0,
            "TTY":"?",
            "Time":0,
            "User":"root"
         },
         {
            "CPU":0,
            "Command":"[vfio-irqfd-clea]",
            "Memory":0,
            "Pid":0,
            "TTY":"?",
            "Time":0,
            "User":"root"
         },
         {
            "CPU":0,
            "Command":"[kworker/5:1H-events_highpri]",
            "Memory":0,
            "Pid":0,
            "TTY":"?",
            "Time":0,
            "User":"root"
         },
         {
            "CPU":0,
            "Command":"[kworker/4:1H-kblockd]",
            "Memory":0,
            "Pid":0,
            "TTY":"?",
            "Time":0,
            "User":"root"
         },
         {
            "CPU":0,
            "Command":"[mld]",
            "Memory":0,
            "Pid":0,
            "TTY":"?",
            "Time":0,
            "User":"root"
         },
         {
            "CPU":0,
            "Command":"[ipv6_addrconf]",
            "Memory":0,
            "Pid":0,
            "TTY":"?",
            "Time":0,
            "User":"root"
         },
         {
            "CPU":0,
            "Command":"[kstrp]",
            "Memory":0,
            "Pid":0,
            "TTY":"?",
            "Time":0,
            "User":"root"
         },
         {
            "CPU":0,
            "Command":"[zswap-shrink]",
            "Memory":0,
            "Pid":0,
            "TTY":"?",
            "Time":0,
            "User":"root"
         },
         {
            "CPU":0,
            "Command":"[charger_manager]",
            "Memory":0,
            "Pid":0,
            "TTY":"?",
            "Time":0,
            "User":"root"
         },
         {
            "CPU":0,
            "Command":"[kworker/2:1H-kblockd]",
            "Memory":0,
            "Pid":0,
            "TTY":"?",
            "Time":0,
            "User":"root"
         },
         {
            "CPU":0,
            "Command":"[kworker/6:1H-events_highpri]",
            "Memory":0,
            "Pid":0,
            "TTY":"?",
            "Time":0,
            "User":"root"
         },
         {
            "CPU":0,
            "Command":"/usr/lib/policykit-1/polkitd --no-debug",
            "Memory":0,
            "Pid":0,
            "TTY":"?",
            "Time":1,
            "User":"root"
         },
         {
            "CPU":0,
            "Command":"/usr/sbin/rsyslogd -n -iNONE",
            "Memory":0,
            "Pid":0,
            "TTY":"?",
            "Time":0,
            "User":"syslog"
         },
         {
            "CPU":0,
            "Command":"/usr/lib/snapd/snapd",
            "Memory":0.2,
            "Pid":0,
            "TTY":"?",
            "Time":4,
            "User":"root"
         },
         {
            "CPU":0,
            "Command":"/usr/libexec/switcheroo-control",
            "Memory":0,
            "Pid":0,
            "TTY":"?",
            "Time":0,
            "User":"root"
         },
         {
            "CPU":0,
            "Command":"/lib/systemd/systemd-logind",
            "Memory":0,
            "Pid":0,
            "TTY":"?",
            "Time":0,
            "User":"root"
         },
         {
            "CPU":0,
            "Command":"/usr/sbin/thermald --systemd --dbus-enable --adaptive",
            "Memory":0,
            "Pid":0,
            "TTY":"?",
            "Time":42,
            "User":"root"
         },
         {
            "CPU":0,
            "Command":"/usr/lib/udisks2/udisksd",
            "Memory":0,
            "Pid":0,
            "TTY":"?",
            "Time":0,
            "User":"root"
         },
         {
            "CPU":0,
            "Command":"/sbin/wpa_supplicant -u -s -O /run/wpa_supplicant",
            "Memory":0,
            "Pid":0,
            "TTY":"?",
            "Time":0,
            "User":"root"
         },
         {
            "CPU":0,
            "Command":"avahi-daemon: chroot helper",
            "Memory":0,
            "Pid":0,
            "TTY":"?",
            "Time":0,
            "User":"avahi"
         },
         {
            "CPU":0,
            "Command":"/usr/sbin/ModemManager",
            "Memory":0,
            "Pid":0,
            "TTY":"?",
            "Time":0,
            "User":"root"
         },
         {
            "CPU":0,
            "Command":"/usr/libexec/boltd",
            "Memory":0,
            "Pid":0,
            "TTY":"?",
            "Time":0,
            "User":"root"
         },
         {
            "CPU":0,
            "Command":"/usr/bin/containerd",
            "Memory":0.3,
            "Pid":0,
            "TTY":"?",
            "Time":77,
            "User":"root"
         },
         {
            "CPU":0,
            "Command":"/usr/bin/redis-server 127.0.0.1:6379",
            "Memory":0,
            "Pid":0,
            "TTY":"?",
            "Time":36,
            "User":"redis"
         },
         {
            "CPU":0,
            "Command":"/usr/lib/postgresql/12/bin/postgres -D /var/lib/postgresql/12/main -c config_file=/etc/postgresql/12/main/postgresql.conf",
            "Memory":0.1,
            "Pid":0,
            "TTY":"?",
            "Time":0,
            "User":"postgres"
         },
         {
            "CPU":0,
            "Command":"postgres: 12/main: checkpointer",
            "Memory":0,
            "Pid":0,
            "TTY":"?",
            "Time":0,
            "User":"postgres"
         },
         {
            "CPU":0,
            "Command":"postgres: 12/main: background writer",
            "Memory":0,
            "Pid":0,
            "TTY":"?",
            "Time":0,
            "User":"postgres"
         },
         {
            "CPU":0,
            "Command":"postgres: 12/main: walwriter",
            "Memory":0,
            "Pid":0,
            "TTY":"?",
            "Time":0,
            "User":"postgres"
         },
         {
            "CPU":0,
            "Command":"postgres: 12/main: autovacuum launcher",
            "Memory":0,
            "Pid":0,
            "TTY":"?",
            "Time":0,
            "User":"postgres"
         },
         {
            "CPU":0,
            "Command":"postgres: 12/main: stats collector",
            "Memory":0,
            "Pid":0,
            "TTY":"?",
            "Time":0,
            "User":"postgres"
         },
         {
            "CPU":0,
            "Command":"postgres: 12/main: logical replication launcher",
            "Memory":0,
            "Pid":0,
            "TTY":"?",
            "Time":0,
            "User":"postgres"
         },
         {
            "CPU":0,
            "Command":"/usr/bin/python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal",
            "Memory":0.1,
            "Pid":0,
            "TTY":"?",
            "Time":0,
            "User":"root"
         },
         {
            "CPU":0,
            "Command":"/usr/lib/upower/upowerd",
            "Memory":0,
            "Pid":0,
            "TTY":"?",
            "Time":1,
            "User":"root"
         },
         {
            "CPU":0,
            "Command":"/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock",
            "Memory":0.5,
            "Pid":0,
            "TTY":"?",
            "Time":6,
            "User":"root"
         },
         {
            "CPU":0,
            "Command":"/usr/bin/whoopsie -f",
            "Memory":0,
            "Pid":0,
            "TTY":"?",
            "Time":0,
            "User":"whoopsie"
         },
         {
            "CPU":0,
            "Command":"/usr/sbin/kerneloops --test",
            "Memory":0,
            "Pid":0,
            "TTY":"?",
            "Time":0,
            "User":"kernoops"
         },
         {
            "CPU":0,
            "Command":"/usr/sbin/kerneloops",
            "Memory":0,
            "Pid":0,
            "TTY":"?",
            "Time":0,
            "User":"kernoops"
         },
         {
            "CPU":0,
            "Command":"bpfilter_umh",
            "Memory":0,
            "Pid":0,
            "TTY":"?",
            "Time":0,
            "User":"root"
         }
      ]
   }
}
  • Uptime
{
   "Error":false,
   "Message":{
      "Host":"0.0.0.0",
      "Name":"uptime",
      "Platform":"Linux",
      "Data":{
         "Idle":164374.76,
         "IdlePercent":0,
         "Up":566391.23
      }
   }
}

Charts

Several types of charts that can be used to appropriately display metrics provided by inspectors. These should be implemented using termdash

Some simple

  • LineChart
  • BarChart
  • Donut
  • HeatMap

Override global command list

Currently the metrics are defined globally and all hosts attempt to run them, however we would like to be able to extend commands for a single host by doing something like

hosts:
  children:
    "0.0.0.0":
      metrics:
        docker:
      connection:
        type: ssh 
        username: ci-dev
        port: 2222
        private_key_path: "/home/diretnan/Projects/Personal/saido/ssh-key/ci/ci-test-key"
    "localhost":
      connection:
        type: local
metrics:
  custom: "cat /proc/uptime"
  loadavg:

poll-interval: 10

Docker metric (along with custom and loadavg) would only run for 0.0.0.0 while Custom and Loadavg would be run for the rest i.e localhost

Inspectors

Inspectors are responsible for retrieving specific statistics from a driver via the use of a particular command

Some rudimentary inspectors to implement are

  • Disk
  • Memory
  • Load Average
  • System (Uptime)
  • Docker stats
  • Tcp port inspector
  • Custom

Define Interfaces

These interfaces are to be defined to make the project modular and easily extensible

  • #2 (methods that every inspector should have e.g getMetrics)
  • #3 (methods that every driver should implement e.g runCommand, readFile)
  • #4

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.