Skip to content

Gathers and Publish information about the Hardware, OS, Network and Processes of the current running machine through a JSON API (Linux & Windows Compatible)

License

Notifications You must be signed in to change notification settings

juanhuttemann/go-server-monitor-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-server-monitor-api

Gathers and Publish information about the Hardware, OS, Network and Processes of the current running machine through a JSON API (Linux & Windows Compatible)

preview preview

Clone

git clone git@github.com:juanhuttemann/go-server-monitor-api.git

Dependencies

go get github.com/shirou/gopsutil/cpu
go get github.com/shirou/gopsutil/disk
go get github.com/shirou/gopsutil/host
go get github.com/shirou/gopsutil/mem
go get github.com/mitchellh/go-ps
go get github.com/spf13/viper

Build

go build -o gomonitor src/*.go

Usage

./gomonitor

Then go to your web browser at http://localhost:3000

JSON Data References

  • hostInfo (object)

    • name (string): Host name
    • os (string): Operative System
    • arch (string): x86/x64
    • platform (string): OS Name, Version and Build
    • uptime (integer): amount of seconds since bootup
  • cpu (object)

    • name (string): Brand - Model of the Physical CPU
    • total (integer): Amount of Physical Cores
    • usage (float): Percentage of Physical CPU Usage
    • usagePerCore (Array): Array of Percentage of Logical CPU Usage
  • ram (object)

    • free (integer): Available Physical RAM in bytes
    • total (integer): Total of Physical RAM in bytes
    • usage (integer): Usage of Physical RAM in bytes
  • disks (array of objects)

    • mountPoint (string): Disk current mount path or Unit in Windows
    • size (integer): Total Disk space in bytes
    • used (integer): Used Disk space in bytes
    • percent (integer): Percentage of Disk Usage
  • networkDevices (array of objects)

    • name (string): Name of the Network Interface
    • addresses (array of objects):
      • cidr (string): Classless Inter-Domain Routing
      • ip (string): IP Address
    • mac (string): Mac Address
    • up (boolean): If the Net Interface is Up or Down

Custom Settings

Webserver API Port

By default, the embedded server start on port 3000. We can provide a different value in the config.yml file:

# api server port
port: 45000

Modules

For enabling/disabling modules just edit the config.yml file changing the values by true or false

#available modules
hostInfo: true
cpu: true
ram: true
disks: true
networkDevices: false
networkBandwidth: true
processes: false

About

Gathers and Publish information about the Hardware, OS, Network and Processes of the current running machine through a JSON API (Linux & Windows Compatible)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published