Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
2b713c3dd4 | |||
![]() |
af03ded75f | ||
![]() |
00760eebda | ||
![]() |
8b887b2380 | ||
![]() |
9f918d1ae9 | ||
![]() |
49a9aeeff5 | ||
![]() |
04754bdf48 | ||
![]() |
9691f4bbf7 | ||
![]() |
b78b558fb7 | ||
![]() |
01df5b7739 |
13
README.md
13
README.md
@ -4,8 +4,17 @@ Fork of hyperic/sigar with some fixes. Support only ruby binding. Part of [Eye g
|
|||||||
|
|
||||||
## Fixed:
|
## Fixed:
|
||||||
|
|
||||||
### [2.0.7] 02-10-2020
|
### [2.0.11] 10-09-2024
|
||||||
* Fix compilation on MacOS [#6](https://github.com/kostya/sigar/issues/8)([commit](https://github.com/kostya/sigar/pull/9/commits/ad39547629fa328e115f7d7bc3c7c358247d1961))
|
* Fixing build issue on newer linux and also issues with newer Ruby [#16](https://github.com/kostya/sigar/pull/16)([commit](https://github.com/kostya/sigar/pull/16/commits/8b887b2380c4aadea82402904d9c1131bbb9c521))
|
||||||
|
|
||||||
|
### [2.0.10] 31-10-2021
|
||||||
|
* Fix compilation on MacOS 11.3.1 [#11](https://github.com/kostya/sigar/issues/11)([commit](https://github.com/kostya/sigar/commit/49a9aeeff54e97ac6f41d464c30ff6c8adf4bcf4))
|
||||||
|
|
||||||
|
### [2.0.9] 28-06-2021
|
||||||
|
* Fix compilation on FreeBSD 13 [#10](https://github.com/kostya/sigar/issues/10)([commit](https://github.com/kostya/sigar/commit/b78b558fb756a75dc7d6cbf704423be3c7098ae5))
|
||||||
|
|
||||||
|
### [2.0.8] 02-10-2020
|
||||||
|
* Fix compilation on MacOS [#8](https://github.com/kostya/sigar/issues/8)([commit](https://github.com/kostya/sigar/pull/9/commits/ad39547629fa328e115f7d7bc3c7c358247d1961))
|
||||||
|
|
||||||
### [2.0.6] 18-01-2019
|
### [2.0.6] 18-01-2019
|
||||||
* Fix compilation on FreeBSD 12 [#6](https://github.com/kostya/sigar/issues/6)([commit](https://github.com/kostya/sigar/commit/2bb67fa1bf6f6f0ddc2626cf028bcc0e4a8cb377))
|
* Fix compilation on FreeBSD 12 [#6](https://github.com/kostya/sigar/issues/6)([commit](https://github.com/kostya/sigar/commit/2bb67fa1bf6f6f0ddc2626cf028bcc0e4a8cb377))
|
||||||
|
11
Rakefile
11
Rakefile
@ -27,7 +27,6 @@ spec = Gem::Specification.new do |s|
|
|||||||
s.email = props['project.email']
|
s.email = props['project.email']
|
||||||
s.homepage = props['project.homepage']
|
s.homepage = props['project.homepage']
|
||||||
s.platform = Gem::Platform::RUBY
|
s.platform = Gem::Platform::RUBY
|
||||||
s.has_rdoc = false
|
|
||||||
s.extensions = 'bindings/ruby/extconf.rb'
|
s.extensions = 'bindings/ruby/extconf.rb'
|
||||||
s.files =
|
s.files =
|
||||||
%w(LICENSE NOTICE README.md Rakefile version.properties) +
|
%w(LICENSE NOTICE README.md Rakefile version.properties) +
|
||||||
@ -52,15 +51,15 @@ end
|
|||||||
desc 'Build sigar extension'
|
desc 'Build sigar extension'
|
||||||
task :build do
|
task :build do
|
||||||
in_ext()
|
in_ext()
|
||||||
unless File.exists? "Makefile"
|
unless File.exist? "Makefile"
|
||||||
unless system("ruby extconf.rb")
|
unless system("ruby extconf.rb")
|
||||||
STDERR.puts "Failed to configure"
|
STDERR.puts "Failed to configure"
|
||||||
break
|
next
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
unless system(MAKE)
|
unless system(MAKE)
|
||||||
STDERR.puts 'Failed to ' + MAKE
|
STDERR.puts 'Failed to ' + MAKE
|
||||||
break
|
next
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -76,13 +75,13 @@ end
|
|||||||
desc 'Clean sigar extension'
|
desc 'Clean sigar extension'
|
||||||
task :clean do
|
task :clean do
|
||||||
in_ext()
|
in_ext()
|
||||||
system(MAKE + ' clean') if File.exists? "Makefile"
|
system(MAKE + ' clean') if File.exist? "Makefile"
|
||||||
end
|
end
|
||||||
|
|
||||||
desc 'Dist Clean sigar extension'
|
desc 'Dist Clean sigar extension'
|
||||||
task :distclean do
|
task :distclean do
|
||||||
in_ext()
|
in_ext()
|
||||||
system(MAKE + ' distclean') if File.exists? "Makefile"
|
system(MAKE + ' distclean') if File.exist? "Makefile"
|
||||||
end
|
end
|
||||||
|
|
||||||
desc 'Run sigar examples (test)'
|
desc 'Run sigar examples (test)'
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
Gem::Specification.new do |s|
|
Gem::Specification.new do |s|
|
||||||
s.name = "kostya-sigar"
|
s.name = "kostya-sigar"
|
||||||
s.version = "2.0.8"
|
s.version = "2.0.11"
|
||||||
|
|
||||||
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
||||||
s.require_paths = ["lib"]
|
s.require_paths = ["lib"]
|
||||||
|
@ -1965,7 +1965,7 @@ int sigar_proc_fd_get(sigar_t *sigar, sigar_pid_t pid,
|
|||||||
free(ofiles);
|
free(ofiles);
|
||||||
#else
|
#else
|
||||||
/* seems the same as the above */
|
/* seems the same as the above */
|
||||||
procfd->total = filed.fd_lastfile;
|
procfd->total = filed.fd_nfiles;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return SIGAR_OK;
|
return SIGAR_OK;
|
||||||
@ -3310,20 +3310,20 @@ sigar_tcp_get(sigar_t *sigar,
|
|||||||
return SIGAR_OK;
|
return SIGAR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef SIGAR_FREEBSD5_NFSSTAT
|
// #ifndef SIGAR_FREEBSD5_NFSSTAT
|
||||||
static int get_nfsstats(struct nfsstats *stats)
|
// static int get_nfsstats(struct nfsstats *stats)
|
||||||
{
|
// {
|
||||||
size_t len = sizeof(*stats);
|
// size_t len = sizeof(*stats);
|
||||||
int mib[] = { CTL_VFS, 2, NFS_NFSSTATS };
|
// int mib[] = { CTL_VFS, 2, NFS_NFSSTATS };
|
||||||
|
|
||||||
if (sysctl(mib, NMIB(mib), stats, &len, NULL, 0) < 0) {
|
// if (sysctl(mib, NMIB(mib), stats, &len, NULL, 0) < 0) {
|
||||||
return errno;
|
// return errno;
|
||||||
}
|
// }
|
||||||
else {
|
// else {
|
||||||
return SIGAR_OK;
|
// return SIGAR_OK;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
#endif
|
// #endif
|
||||||
|
|
||||||
#if defined(__OpenBSD__)
|
#if defined(__OpenBSD__)
|
||||||
typedef uint64_t rpc_cnt_t;
|
typedef uint64_t rpc_cnt_t;
|
||||||
@ -3372,25 +3372,25 @@ int sigar_nfs_server_v2_get(sigar_t *sigar,
|
|||||||
int sigar_nfs_client_v3_get(sigar_t *sigar,
|
int sigar_nfs_client_v3_get(sigar_t *sigar,
|
||||||
sigar_nfs_client_v3_t *nfs)
|
sigar_nfs_client_v3_t *nfs)
|
||||||
{
|
{
|
||||||
#ifdef SIGAR_FREEBSD5_NFSSTAT
|
// #ifdef SIGAR_FREEBSD5_NFSSTAT
|
||||||
struct nfsstats stats;
|
// struct nfsstats stats;
|
||||||
size_t size = sizeof(stats);
|
// size_t size = sizeof(stats);
|
||||||
|
|
||||||
if (sysctlbyname("vfs.nfs.nfsstats", &stats, &size, NULL, 0) == -1) {
|
// if (sysctlbyname("vfs.nfs.nfsstats", &stats, &size, NULL, 0) == -1) {
|
||||||
return errno;
|
// return errno;
|
||||||
}
|
// }
|
||||||
|
|
||||||
map_nfs_stats((sigar_nfs_v3_t *)nfs, &stats.rpccnt[0]);
|
// map_nfs_stats((sigar_nfs_v3_t *)nfs, &stats.rpccnt[0]);
|
||||||
#else
|
// #else
|
||||||
int status;
|
// int status;
|
||||||
struct nfsstats stats;
|
// struct nfsstats stats;
|
||||||
|
|
||||||
if ((status = get_nfsstats(&stats)) != SIGAR_OK) {
|
// if ((status = get_nfsstats(&stats)) != SIGAR_OK) {
|
||||||
return status;
|
// return status;
|
||||||
}
|
// }
|
||||||
|
|
||||||
map_nfs_stats((sigar_nfs_v3_t *)nfs, &stats.rpccnt[0]);
|
// map_nfs_stats((sigar_nfs_v3_t *)nfs, &stats.rpccnt[0]);
|
||||||
#endif
|
// #endif
|
||||||
|
|
||||||
return SIGAR_OK;
|
return SIGAR_OK;
|
||||||
}
|
}
|
||||||
@ -3398,25 +3398,25 @@ int sigar_nfs_client_v3_get(sigar_t *sigar,
|
|||||||
int sigar_nfs_server_v3_get(sigar_t *sigar,
|
int sigar_nfs_server_v3_get(sigar_t *sigar,
|
||||||
sigar_nfs_server_v3_t *nfs)
|
sigar_nfs_server_v3_t *nfs)
|
||||||
{
|
{
|
||||||
#ifdef SIGAR_FREEBSD5_NFSSTAT
|
// #ifdef SIGAR_FREEBSD5_NFSSTAT
|
||||||
struct nfsrvstats stats;
|
// struct nfsrvstats stats;
|
||||||
size_t size = sizeof(stats);
|
// size_t size = sizeof(stats);
|
||||||
|
|
||||||
if (sysctlbyname("vfs.nfsrv.nfsrvstats", &stats, &size, NULL, 0) == -1) {
|
// if (sysctlbyname("vfs.nfsrv.nfsrvstats", &stats, &size, NULL, 0) == -1) {
|
||||||
return errno;
|
// return errno;
|
||||||
}
|
// }
|
||||||
|
|
||||||
map_nfs_stats((sigar_nfs_v3_t *)nfs, &stats.srvrpccnt[0]);
|
// map_nfs_stats((sigar_nfs_v3_t *)nfs, &stats.srvrpccnt[0]);
|
||||||
#else
|
// #else
|
||||||
int status;
|
// int status;
|
||||||
struct nfsstats stats;
|
// struct nfsstats stats;
|
||||||
|
|
||||||
if ((status = get_nfsstats(&stats)) != SIGAR_OK) {
|
// if ((status = get_nfsstats(&stats)) != SIGAR_OK) {
|
||||||
return status;
|
// return status;
|
||||||
}
|
// }
|
||||||
|
|
||||||
map_nfs_stats((sigar_nfs_v3_t *)nfs, &stats.srvrpccnt[0]);
|
// map_nfs_stats((sigar_nfs_v3_t *)nfs, &stats.srvrpccnt[0]);
|
||||||
#endif
|
// #endif
|
||||||
|
|
||||||
return SIGAR_OK;
|
return SIGAR_OK;
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/times.h>
|
#include <sys/times.h>
|
||||||
#include <sys/utsname.h>
|
#include <sys/utsname.h>
|
||||||
|
#include <sys/sysmacros.h>
|
||||||
|
|
||||||
#include "sigar.h"
|
#include "sigar.h"
|
||||||
#include "sigar_private.h"
|
#include "sigar_private.h"
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
|
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
#include <sys/time.h>
|
||||||
|
|
||||||
SIGAR_INLINE char *sigar_uitoa(char *buf, unsigned int n, int *len)
|
SIGAR_INLINE char *sigar_uitoa(char *buf, unsigned int n, int *len)
|
||||||
{
|
{
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
copyright.year=2004-2011
|
copyright.year=2004-2011
|
||||||
version.major=2
|
version.major=2
|
||||||
version.minor=0
|
version.minor=0
|
||||||
version.maint=8
|
version.maint=11
|
||||||
version.build=0
|
version.build=0
|
||||||
project.name=kostya-sigar
|
project.name=kostya-sigar
|
||||||
project.author=Doug MacEachern
|
project.author=Doug MacEachern
|
||||||
|
Loading…
Reference in New Issue
Block a user