Node binding to SIGAR (System Information Gatherer And Reporter)
_ _ _ _____ _
| \ | | | | / ____(_)
| \| | ___ __| | ___| (___ _ __ _ __ _ _ __
| . ` |/ _ \ / _` |/ _ \\___ \| |/ _` |/ _` | '__|
| |\ | (_) | (_| | __/____) | | (_| | (_| | |
|_| \_|\___/ \__,_|\___|_____/|_|\__, |\__,_|_| New BSD License
__/ |
|___/
The project is Node binding to the SIGAR library. Source code is available on Github.
SIGAR includes support for Linux, FreeBSD, Windows, Solaris, AIX, HP-UX and Mac OSX across a variety of versions and architectures. Users of the SIGAR API are given portable access to inventory and monitoring data including:
- System memory, swap, cpu, load average, uptime, logins
- Per-process memory, cpu, credential info, state, arguments, environment, open files
- File system detection and metrics
- Network interface detection, configuration information and metrics
- Network route and connection tables
Installation
Node SIGAR is open source and licensed under the new BSD license.
1
| |
In case of trouble, refer to the “requirements” section below.
Quick example
1 2 3 4 5 6 | |
API - System
mem
Return an object with ‘ram’, ‘total’, ‘used’, ‘free’, ‘actual_used’, ‘actual_free’, ‘used_percent’, ‘free_percent’ information.swap
Return an object with ‘total’, ‘used’, ‘free’,’page_in’,’page_out’ information.uptime
Show how long system has been running in seconds.loadavg
Show average load in pourcent for the last minute, last 5 minutes and the last 15 minutes.
Return an array with 3 float values.resourceLimit
Return an object with ‘cpu_cur’, ‘cpu_max’, ‘file_size_cur’, ‘file_size_max’, ‘pipe_size_cur’, ‘pipe_size_max’, ‘data_cur’, ‘data_max’, ‘stack_cur’, ‘stack_max’, ‘core_cur’, ‘core_max’, ‘memory_cur’, ‘memory_max’, ‘processes_cur’, ‘processes_max’, ‘open_files_cur’, ‘open_files_max’, ‘virtual_memory_cur’, ‘virtual_memory_max’ informations.whoListversion
Return an object with ‘build_date’, ‘scm_revision’, ‘version’, ‘archname’, ‘archlib’, ‘binname’, ‘description’, ‘major’, ‘minor’, ‘maint’, ‘build’ informations.sysInfofqdn
Return the hostname or the IP address (hostname on OSX, IP address on Unbuntu)
API - CPU
cpucpuListcpuInfoList
API - Process
procListprocStatprocMemprocCredprocTimeprocCpuprocStateprocArgsprocEnvprocFdprocExeprocModulesprocPortthreadCpu
API - Disk
fileSystemListfileSystemUsagefileSystemPing
API - Network
netInfonetRouteListnetInterfaceListnetInterfaceConfignetInterfaceConfigPrimarynetInterfaceStatnetConnectionListnetListenAddressnetStatnetStatPorttcpnfsClientV2nfsServerV2arpList
API - Misc
rpcPingpasswordformatSize
Testing
Run the tests with expresso:
1 2 | |
Requirements
Ubuntu
1
| |
OSX (using homebrew)
1 2 3 | |
Resources
Contributors
- David Worms : https://github.com/wdavidw