diff options
author | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-10-20 06:50:06 +0000 |
---|---|---|
committer | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-10-20 06:50:06 +0000 |
commit | 8ed7078d8812519fb2702e829681586d9d4f27c9 (patch) | |
tree | 9e0423d5948e4c0da7304ff544e57831d5417da9 | |
parent | 07ce87b9cf251b14767064180de7b27a23c272e8 (diff) | |
download | zabbix-8ed7078d8812519fb2702e829681586d9d4f27c9.tar.gz zabbix-8ed7078d8812519fb2702e829681586d9d4f27c9.tar.xz zabbix-8ed7078d8812519fb2702e829681586d9d4f27c9.zip |
- added support of vfs.dev.read.bytes[*] (Eugene)
- added support of vfs.dev.read.operations[*] (Eugene)
- added support of vfs.dev.write.bytes[*] (Eugene)
- added support of vfs.dev.write.operations[*] (Eugene)
- added support of net.if.out.errors[*] (Eugene)
- added support of net.if.out.packets[*] (Eugene)
- added support of net.if.out.bytes[*] (Eugene)
- added support of net.if.in.errors[*] (Eugene)
- added support of net.if.in.packets[*] (Eugene)
- added support of net.if.in.bytes[*] (Eugene)
- added support of net.if.collisions[*] (Eugene)
- removed net[listen_80] from solaris (Eugene)
- removed net[listen_23] from solaris (Eugene)
- removed disk_read_ops[*] (Eugene)
- removed disk_read_kbs[*] (Eugene)
- removed disk_write_ops[*] (Eugene)
- removed disk_write_kbs[*] (Eugene)
- removed disk_busy[*] (Eugene)
- removed disk_svc[*] (Eugene)
- removed net.out.err[*] (Eugene)
- removed net.out.pack[*] (Eugene)
- removed net.out.load[*] (Eugene)
- removed net.in.err[*] (Eugene)
- removed net.in.pack[*] (Eugene)
- removed net.in.load[*] (Eugene)
- removed net.out.coll[*] (Eugene)
git-svn-id: svn://svn.zabbix.com/trunk@2207 97f52cf1-0a1b-0410-bd0e-c28be96e8082
-rw-r--r-- | src/libs/zbxsysinfo/solaris/diskio.c | 273 | ||||
-rw-r--r-- | src/libs/zbxsysinfo/solaris/net.c | 284 | ||||
-rw-r--r-- | src/libs/zbxsysinfo/solaris/solaris.c | 107 |
3 files changed, 336 insertions, 328 deletions
diff --git a/src/libs/zbxsysinfo/solaris/diskio.c b/src/libs/zbxsysinfo/solaris/diskio.c index 3f5186cc..7315c8c7 100644 --- a/src/libs/zbxsysinfo/solaris/diskio.c +++ b/src/libs/zbxsysinfo/solaris/diskio.c @@ -135,6 +135,16 @@ #include "common.h" #include "sysinfo.h" +/* +#define FDI(f, m) fprintf(stderr, "DEBUG INFO: " f "\n" , m) // show debug info to stderr +#define SDI(m) FDI("%s", m) // string info +#define IDI(i) FDI("%i", i) // integer info +*/ + +#if 0 +/* + * hidden + */ typedef struct busy_data { hrtime_t clock; @@ -175,7 +185,7 @@ typedef struct wblocks_data typedef struct disk_data { struct disk_data *next; - char *name; + char name[MAX_STRING_LEN]; BUSY_DATA busy; SVC_TIME_DATA svc; READ_IOS_DATA reads; @@ -183,17 +193,18 @@ typedef struct disk_data RBLOCKS_DATA rblocks; WBLOCKS_DATA wblocks; } DISK_DATA; +#endif -static DISK_DATA *disks; - +#if 0 +/* + * hidden + */ static DISK_DATA *get_disk_data_record(const char *device) { + static DISK_DATA *disks; DISK_DATA *p; - p = disks; - - while ((p) && (strcmp(p->name, device) != 0)) - p = p->next; + for(p = disks; (p) && (strncmp(p->name, device, MAX_STRING_LEN) != 0); p = p->next) if (p == (DISK_DATA *) NULL) { @@ -201,7 +212,7 @@ static DISK_DATA *get_disk_data_record(const char *device) if (p) { - p->name = strdup(device); + strncpy(p->name, device, MAX_STRING_LEN); if (p->name) { @@ -221,7 +232,12 @@ static DISK_DATA *get_disk_data_record(const char *device) return p; } +#endif +#if 0 +/* + * hidden + */ static int get_disk_kstat_record(const char *name, hrtime_t *crtime, hrtime_t *snaptime, @@ -240,8 +256,8 @@ static int get_disk_kstat_record(const char *name, if (kt) { - if ((kt->ks_type == KSTAT_TYPE_IO) && - (kstat_read(kc, kt, returned_data) != -1) + if ( (kt->ks_type == KSTAT_TYPE_IO) + && (kstat_read(kc, kt, returned_data) != -1) ) { *crtime = kt->ks_crtime; @@ -255,8 +271,13 @@ static int get_disk_kstat_record(const char *name, return result; } +#endif -int DISKREADOPS(const char *cmd, const char *device,double *value) +#if 0 +/* + * hidden + */ +int DISKSVC(const char *cmd, const char *device, double *value) { int result = SYSINFO_RET_FAIL; DISK_DATA *p; @@ -272,26 +293,31 @@ int DISKREADOPS(const char *cmd, const char *device,double *value) if (result == SYSINFO_RET_OK) { - int interval_seconds; - - interval_seconds = (snaptime - p->reads.clock) / 1000000000; + unsigned long ios; - if (interval_seconds > 0) - *value = (kio.reads - p->reads.reads) / interval_seconds; + ios = (kio.reads - p->svc.reads) + (kio.writes - p->svc.writes); - else - *value = 0.0; + if (ios > 0) + *value = ((kio.rtime - p->svc.rtime)/ios)/1000000.0; - p->reads.clock = snaptime; + else + *value = 0.0; - p->reads.reads = kio.reads; + p->svc.writes = kio.writes; + p->svc.reads = kio.reads; + p->svc.rtime = kio.rtime; } } - return result; + return result; } +#endif -int DISKREADBLOCKS(const char *cmd, const char *device,double *value) +#if 0 +/* + * hidden + */ +int DISKBUSY(const char *cmd, const char *device, double *value) { int result = SYSINFO_RET_FAIL; DISK_DATA *p; @@ -307,159 +333,140 @@ int DISKREADBLOCKS(const char *cmd, const char *device,double *value) if (result == SYSINFO_RET_OK) { - int interval_seconds; - - interval_seconds = (snaptime - p->rblocks.clock) / 1000000000; - - if (interval_seconds > 0) - *value = ((kio.nread - p->rblocks.nread) / 1024.0) / interval_seconds; + if (snaptime > p->busy.clock) + *value = ((kio.rtime - p->busy.rtime) * 100.0) / (snaptime - p->busy.clock); else - *value = 0.0; + *value = 0.0; - p->rblocks.clock = snaptime; + p->busy.clock = snaptime; - p->rblocks.nread = kio.nread; + p->busy.rtime = kio.rtime; } } - return result; + return result; } +#endif -int DISKWRITEOPS(const char *cmd, const char *device,double *value) +static int get_kstat_io( + const char *name, + kstat_io_t *returned_data + ) { - int result = SYSINFO_RET_FAIL; - DISK_DATA *p; - - p = get_disk_data_record(device); + int result = SYSINFO_RET_FAIL; + kstat_ctl_t *kc; + kstat_t *kt; - if (p) + kc = kstat_open(); + if (kc) { - hrtime_t crtime, snaptime; - kstat_io_t kio; - - result = get_disk_kstat_record(device, &crtime, &snaptime, &kio); - - if (result == SYSINFO_RET_OK) - { - int interval_seconds; - - interval_seconds = (snaptime - p->writes.clock) / 1000000000; - - if (interval_seconds > 0) - *value = (kio.writes - p->writes.writes) / interval_seconds; - - else - *value = 0.0; - - p->writes.clock = snaptime; - - p->writes.writes = kio.writes; - } + kt = kstat_lookup(kc, NULL, -1, (char *) name); + if (kt) + { + if (kt->ks_type == KSTAT_TYPE_IO) + { + if(kstat_read(kc, kt, returned_data) != -1) + { + result = SYSINFO_RET_OK; + } + } + } + kstat_close(kc); } - - return result; + return result; } -int DISKWRITEBLOCKS(const char *cmd, const char *device,double *value) +int VFS_DEV_READ_BYTES(const char *cmd, const char *param, double *value) { - int result = SYSINFO_RET_FAIL; - DISK_DATA *p; - - p = get_disk_data_record(device); + kstat_io_t kio; + char device[MAX_STRING_LEN]; + int result; - if (p) + if(num_param(param) > 1) { - hrtime_t crtime, snaptime; - kstat_io_t kio; - - result = get_disk_kstat_record(device, &crtime, &snaptime, &kio); - - if (result == SYSINFO_RET_OK) - { - int interval_seconds; - - interval_seconds = (snaptime - p->wblocks.clock) / 1000000000; - - if (interval_seconds > 0) - *value = ((kio.nwritten - p->wblocks.nwritten) / 1024.0) / interval_seconds; - - else - *value = 0.0; - - p->wblocks.clock = snaptime; + return SYSINFO_RET_FAIL; + } - p->wblocks.nwritten = kio.nwritten; - } + if(get_param(param, 1, device, MAX_STRING_LEN) != 0) + { + return SYSINFO_RET_FAIL; } + + result = get_kstat_io(device, &kio); - return result; + *value = kio.reads; + + return result; } -int DISKBUSY(const char *cmd, const char *device, double *value) +int VFS_DEV_READ_OPERATIONS(const char *cmd, const char *param, double *value) { - int result = SYSINFO_RET_FAIL; - DISK_DATA *p; - - p = get_disk_data_record(device); + kstat_io_t kio; + char device[MAX_STRING_LEN]; + int result; - if (p) + if(num_param(param) > 1) { - hrtime_t crtime, snaptime; - kstat_io_t kio; - - result = get_disk_kstat_record(device, &crtime, &snaptime, &kio); - - if (result == SYSINFO_RET_OK) - { - if (snaptime > p->busy.clock) - *value = ((kio.rtime - p->busy.rtime) * 100.0) / (snaptime - p->busy.clock); - - else - *value = 0.0; - - p->busy.clock = snaptime; + return SYSINFO_RET_FAIL; + } - p->busy.rtime = kio.rtime; - } + if(get_param(param, 1, device, MAX_STRING_LEN) != 0) + { + return SYSINFO_RET_FAIL; } + + result = get_kstat_io(device, &kio); - return result; + *value = kio.nread; + + return result; } -int DISKSVC(const char *cmd, const char *device, double *value) +int VFS_DEV_WRITE_BYTES(const char *cmd, const char *param, double *value) { - int result = SYSINFO_RET_FAIL; - DISK_DATA *p; + kstat_io_t kio; + char device[MAX_STRING_LEN]; + int result; - p = get_disk_data_record(device); - - if (p) + if(num_param(param) > 1) { - hrtime_t crtime, snaptime; - kstat_io_t kio; + return SYSINFO_RET_FAIL; + } - result = get_disk_kstat_record(device, &crtime, &snaptime, &kio); + if(get_param(param, 1, device, MAX_STRING_LEN) != 0) + { + return SYSINFO_RET_FAIL; + } + + result = get_kstat_io(device, &kio); - if (result == SYSINFO_RET_OK) - { - unsigned long ios; + *value = kio.writes; - ios = (kio.reads - p->svc.reads) + (kio.writes - p->svc.writes); + return result; +} - if (ios > 0) - *value = ((kio.rtime - p->svc.rtime)/ios)/1000000.0; +int VFS_DEV_WRITE_OPERATIONS(const char *cmd, const char *param, double *value) +{ + kstat_io_t kio; + char device[MAX_STRING_LEN]; + int result; - else - *value = 0.0; + if(num_param(param) > 1) + { + return SYSINFO_RET_FAIL; + } - p->svc.writes = kio.writes; - p->svc.reads = kio.reads; - p->svc.rtime = kio.rtime; - } + if(get_param(param, 1, device, MAX_STRING_LEN) != 0) + { + return SYSINFO_RET_FAIL; } + + result = get_kstat_io(device, &kio); - return result; + *value = kio.nwritten; + + return result; } int DISKREADOPS1(const char *cmd, const char *device,double *value) diff --git a/src/libs/zbxsysinfo/solaris/net.c b/src/libs/zbxsysinfo/solaris/net.c index f4ebc608..6e81e24e 100644 --- a/src/libs/zbxsysinfo/solaris/net.c +++ b/src/libs/zbxsysinfo/solaris/net.c @@ -113,6 +113,7 @@ #define IDI(i) FDI("%i", i) // integer info */ +#if 0 typedef union value_overlay { union @@ -187,12 +188,12 @@ static NETWORK_DATA *get_net_data_record(const char *device) } return p; } +#endif -static int get_named_field( +static int get_kstat_named_field( const char *name, const char *field, - kstat_named_t *returned_data, - hrtime_t *snaptime + kstat_named_t *returned_data ) { int result = SYSINFO_RET_FAIL; @@ -204,13 +205,12 @@ static int get_named_field( kc = kstat_open(); if (kc) { - kp = kstat_lookup(kc, NULL, -1, name); + kp = kstat_lookup(kc, NULL, -1, (char*) name); if ((kp) && (kstat_read(kc, kp, 0) != -1)) { - kn = (kstat_named_t*) kstat_data_lookup(kp, field); + kn = (kstat_named_t*) kstat_data_lookup(kp, (char*) field); if(kn) { - *snaptime = kp->ks_snaptime; *returned_data = *kn; result = SYSINFO_RET_OK; } @@ -220,192 +220,202 @@ static int get_named_field( return result; } -int NET_IN_LOAD(const char *cmd, const char *parameter,double *value) +int NET_IF_IN_BYTES(const char *cmd, const char *param,double *value) { - int result = SYSINFO_RET_FAIL; - NETWORK_DATA *p; kstat_named_t kn; - hrtime_t snaptime; - int interval_seconds; + char interface[MAX_STRING_LEN]; + int result; - p = get_net_data_record(parameter); - if(p) + if(num_param(param) > 1) { - result = get_named_field(parameter, "rbytes64", &kn, &snaptime); - if (result == SYSINFO_RET_OK) - { - interval_seconds = (snaptime - p->rb.clock) / 1000000000; - *value = (double) (kn.value.ui64 - p->rb.rbytes.u.ui64) / interval_seconds; - p->rb.rbytes.u.ui64 = kn.value.ui64; - p->rb.clock = snaptime; - } - else - { - result = get_named_field(parameter, "rbytes", &kn, &snaptime); - if (result == SYSINFO_RET_OK) - { - interval_seconds = (snaptime - p->rb.clock) / 1000000000; - *value = (double) (kn.value.ui32 - p->rb.rbytes.u.ui32) / interval_seconds; - p->rb.rbytes.u.ui32 = kn.value.ui32; - p->rb.clock = snaptime; - } - } + return SYSINFO_RET_FAIL; + } + + if(get_param(param, 1, interface, MAX_STRING_LEN) != 0) + { + return SYSINFO_RET_FAIL; + } + + result = get_kstat_named_field(interface, "rbytes64", &kn); + if (result == SYSINFO_RET_OK) + { + *value = (double)kn.value.ui64; } - return result; + else + { + result = get_kstat_named_field(interface, "rbytes", &kn); + *value = (double)kn.value.ui32; + } + + return result; } -int NET_IN_PACKETS(const char *cmd, const char *parameter,double *value) +int NET_IF_IN_PACKETS(const char *cmd, const char *param, double *value) { - int result = SYSINFO_RET_FAIL; - NETWORK_DATA *p; - int interval_seconds; kstat_named_t kn; - hrtime_t snaptime; + char interface[MAX_STRING_LEN]; + int result; + + if(num_param(param) > 1) + { + return SYSINFO_RET_FAIL; + } + + if(get_param(param, 1, interface, MAX_STRING_LEN) != 0) + { + return SYSINFO_RET_FAIL; + } - p = get_net_data_record(parameter); - if(p) + result = get_kstat_named_field(interface, "ipackets64", &kn); + if (result == SYSINFO_RET_OK) { - result = get_named_field(parameter, "ipackets64", &kn, &snaptime); - if (result == SYSINFO_RET_OK) - { - interval_seconds = (snaptime - p->rp.clock) / 1000000000; - *value = (double) (kn.value.ui64 - p->rp.rpackets.u.ui64) / interval_seconds; - p->rp.rpackets.u.ui64 = kn.value.ui64; - p->rp.clock = snaptime; - } - else - { - result = get_named_field(parameter, "ipacket", &kn, &snaptime); - if (result == SYSINFO_RET_OK) - { - interval_seconds = (snaptime - p->rp.clock) / 1000000000; - *value = (double) (kn.value.ui32 - p->rp.rpackets.u.ui32) / interval_seconds; - p->rp.rpackets.u.ui32 = kn.value.ui32; - p->rp.clock = snaptime; - } - } + *value = (double)kn.value.ui64; + } + else + { + result = get_kstat_named_field(interface, "ipackets", &kn); + *value = (double)kn.value.ui32; } - return result; + + return result; } -int NET_IN_ERRORS(const char *cmd, const char *parameter,double *value) +int NET_IF_IN_ERRORS(const char *cmd, const char *param, double *value) { - int result; kstat_named_t kn; - hrtime_t snaptime; - - result = get_named_field(parameter, "ierrors", &kn, &snaptime); + char interface[MAX_STRING_LEN]; + int result; - if (result == SYSINFO_RET_OK) - *value = (double) kn.value.ui32; + if(num_param(param) > 1) + { + return SYSINFO_RET_FAIL; + } + + if(get_param(param, 1, interface, MAX_STRING_LEN) != 0) + { + return SYSINFO_RET_FAIL; + } + + result = get_kstat_named_field(interface, "ierrors", &kn); - return result; + *value = (double)kn.value.ui32; + + return result; } -int NET_OUT_LOAD(const char *cmd, const char *parameter,double *value) +int NET_IF_OUT_BYTES(const char *cmd, const char *param,double *value) { - int result = SYSINFO_RET_FAIL; - NETWORK_DATA *p; kstat_named_t kn; - hrtime_t snaptime; - int interval_seconds; + char interface[MAX_STRING_LEN]; + int result; - p = get_net_data_record(parameter); - if (p) + if(num_param(param) > 1) { - result = get_named_field(parameter, "obytes64", &kn, &snaptime); + return SYSINFO_RET_FAIL; + } - if (result == SYSINFO_RET_OK) - { - interval_seconds = (snaptime - p->ob.clock) / 1000000000; - *value = (double) (kn.value.ui64 - p->ob.obytes.u.ui64) / interval_seconds; - p->ob.obytes.u.ui64 = kn.value.ui64; - p->ob.clock = snaptime; - } - else - { - result = get_named_field(parameter, "obytes", &kn, &snaptime); - if (result == SYSINFO_RET_OK) - { - interval_seconds = (snaptime - p->ob.clock) / 1000000000; - *value = (double) (kn.value.ui32 - p->ob.obytes.u.ui32) / interval_seconds; - p->ob.obytes.u.ui32 = kn.value.ui32; - p->ob.clock = snaptime; - } - } + if(get_param(param, 1, interface, MAX_STRING_LEN) != 0) + { + return SYSINFO_RET_FAIL; } + + result = get_kstat_named_field(interface, "obytes64", &kn); + if (result == SYSINFO_RET_OK) + { + *value = (double)kn.value.ui64; + } + else + { + result = get_kstat_named_field(interface, "obytes", &kn); + *value = (double)kn.value.ui32; + } + return result; } -int NET_OUT_PACKETS(const char *cmd, const char *parameter,double *value) +int NET_IF_OUT_PACKETS(const char *cmd, const char *param,double *value) { - int result = SYSINFO_RET_FAIL; - NETWORK_DATA *p; kstat_named_t kn; - hrtime_t snaptime; - int interval_seconds; + char interface[MAX_STRING_LEN]; + int result; - p = get_net_data_record(parameter); - if (p) + if(num_param(param) > 1) { - result = get_named_field(parameter, "opackets64", &kn, &snaptime); - if (result == SYSINFO_RET_OK) - { - interval_seconds = (snaptime - p->op.clock) / 1000000000; - *value = (double) (kn.value.ui64 - p->op.opackets.u.ui64) / interval_seconds; - p->op.opackets.u.ui64 = kn.value.ui64; - p->op.clock = snaptime; - } - else - { - result = get_named_field(parameter, "opacket", &kn, &snaptime); - if (result == SYSINFO_RET_OK) - { - interval_seconds = (snaptime - p->op.clock) / 1000000000; - *value = (double) (kn.value.ui32 - p->op.opackets.u.ui32) / interval_seconds; - p->op.opackets.u.ui32 = kn.value.ui32; - p->op.clock = snaptime; - } - } + return SYSINFO_RET_FAIL; + } + + if(get_param(param, 1, interface, MAX_STRING_LEN) != 0) + { + return SYSINFO_RET_FAIL; + } + + result = get_kstat_named_field(interface, "opackets64", &kn); + if (result == SYSINFO_RET_OK) + { + *value = (double)kn.value.ui64; } - return result; + else + { + result = get_kstat_named_field(interface, "opackets", &kn); + *value = (double)kn.value.ui32; + } + + return result; } -int NET_OUT_ERRORS(const char *cmd, const char *parameter,double *value) +int NET_IF_OUT_ERRORS(const char *cmd, const char *param,double *value) { - int result; kstat_named_t kn; - hrtime_t snaptime; - - result = get_named_field(parameter, "oerrors", &kn, &snaptime); + char interface[MAX_STRING_LEN]; + int result; - if (result == SYSINFO_RET_OK) - *value = (double) kn.value.ui32; + if(num_param(param) > 1) + { + return SYSINFO_RET_FAIL; + } + if(get_param(param, 1, interface, MAX_STRING_LEN) != 0) + { + return SYSINFO_RET_FAIL; + } + + result = get_kstat_named_field(interface, "oerrors", &kn); + + *value = (double)kn.value.ui32; + return result; } -int NET_COLLISIONS(const char *cmd, const char *parameter,double *value) +int NET_IF_COLLISIONS(const char *cmd, const char *param,double *value) { - int result; kstat_named_t kn; - hrtime_t snaptime; - - result = get_named_field(parameter, "collisions", &kn, &snaptime); + char interface[MAX_STRING_LEN]; + int result; - if (result == SYSINFO_RET_OK) - *value = (double) kn.value.ui32; + if(num_param(param) > 1) + { + return SYSINFO_RET_FAIL; + } + + if(get_param(param, 1, interface, MAX_STRING_LEN) != 0) + { + return SYSINFO_RET_FAIL; + } + + result = get_kstat_named_field(interface, "collisions", &kn); + *value = (double)kn.value.ui32; + return result; } -int NET_TCP_LISTEN(const char *cmd, const char *parameter,double *value) +int NET_TCP_LISTEN(const char *cmd, const char *param,double *value) { char command[MAX_STRING_LEN]; memset(command, '\0', sizeof(command)); - snprintf(command, sizeof(command)-1, "netstat -an | grep '*.%s' | wc -l", parameter); + snprintf(command, sizeof(command)-1, "netstat -an | grep '*.%s' | wc -l", param); return EXECUTE(NULL, command, value); } diff --git a/src/libs/zbxsysinfo/solaris/solaris.c b/src/libs/zbxsysinfo/solaris/solaris.c index ba2a2f32..d5263945 100644 --- a/src/libs/zbxsysinfo/solaris/solaris.c +++ b/src/libs/zbxsysinfo/solaris/solaris.c @@ -81,26 +81,22 @@ int NET_IF_OBYTES15(const char *cmd, const char *parameter,double *value); int NET_IF_OBYTES(const char *cmd, const char *parameter,double *value); int NET_IF_OBYTES15(const char *cmd, const char *parameter,double *value); +int NET_IF_COLLISIONS(const char *cmd, const char *param,double *value); +int NET_IF_OUT_ERRORS(const char *cmd, const char *parameter,double *value); +int NET_IF_OUT_PACKETS(const char *cmd, const char *parameter,double *value); +int NET_IF_OUT_BYTES(const char *cmd, const char *parameter,double *value); +int NET_IF_IN_ERRORS(const char *cmd, const char *parameter,double *value); +int NET_IF_IN_PACKETS(const char *cmd, const char *parameter,double *value); +int NET_IF_IN_BYTES(const char *cmd, const char *parameter,double *value); + int NET_TCP_LISTEN(const char *cmd, const char *parameter,double *value); int TCP_LISTEN(const char *cmd, const char *porthex,double *value); -int NET_IN_LOAD(const char *cmd, const char *parameter,double *value); -int NET_IN_PACKETS(const char *cmd, const char *parameter,double *value); -int NET_IN_ERRORS(const char *cmd, const char *parameter,double *value); - -int NET_OUT_LOAD(const char *cmd, const char *parameter,double *value); -int NET_OUT_PACKETS(const char *cmd, const char *parameter,double *value); -int NET_OUT_ERRORS(const char *cmd, const char *parameter,double *value); - -int NET_COLLISIONS(const char *cmd, const char *parameter,double *value); - -int DISKREADOPS(const char *cmd, const char *parameter,double *value); -int DISKREADBLOCKS(const char *cmd, const char *parameter,double *value); -int DISKWRITEOPS(const char *cmd, const char *parameter,double *value); -int DISKWRITEBLOCKS(const char *cmd, const char *parameter,double *value); -int DISKBUSY(const char *cmd, const char *parameter,double *value); -int DISKSVC(const char *cmd, const char *parameter,double *value); +int VFS_DEV_READ_BYTES(const char *cmd, const char *param,double *value); +int VFS_DEV_READ_OPERATIONS(const char *cmd, const char *param,double *value); +int VFS_DEV_WRITE_BYTES(const char *cmd, const char *param,double *value); +int VFS_DEV_WRITE_OPERATIONS(const char *cmd, const char *param,double *value); int DISKREADOPS1(const char *cmd, const char *parameter,double *value); int DISKREADOPS5(const char *cmd, const char *parameter,double *value); @@ -251,6 +247,27 @@ COMMAND parameters_specific[]= {"vfs.file.regmatch[*]" ,VFS_FILE_REGMATCH, 0, "/etc/passwd,root"}, {"vfs.file.size[*]" ,VFS_FILE_SIZE, 0, "/etc/passwd"}, + {"vfs.dev.read.ops1[*]" ,DISKREADOPS1, 0, "sd0"}, + {"vfs.dev.read.ops5[*]" ,DISKREADOPS5, 0, "sd0"}, + {"vfs.dev.read.ops15[*]" ,DISKREADOPS15, 0, "sd0"}, + + {"vfs.dev.read.blks1[*]" ,DISKREADBLKS1, 0, "sd0"}, + {"vfs.dev.read.blks5[*]" ,DISKREADBLKS5, 0, "sd0"}, + {"vfs.dev.read.blks15[*]" ,DISKREADBLKS15, 0, "sd0"}, + + {"vfs.dev.write.ops1[*]" ,DISKWRITEOPS1, 0, "sd0"}, + {"vfs.dev.write.ops5[*]" ,DISKWRITEOPS5, 0, "sd0"}, + {"vfs.dev.write.ops15[*]" ,DISKWRITEOPS15, 0, "sd0"}, + + {"vfs.dev.write.blks1[*]" ,DISKWRITEBLKS1, 0, "sd0"}, + {"vfs.dev.write.blks5[*]" ,DISKWRITEBLKS5, 0, "sd0"}, + {"vfs.dev.write.blks15[*]" ,DISKWRITEBLKS15, 0, "sd0"}, + + {"vfs.dev.read.bytes[*]" ,VFS_DEV_READ_BYTES, 0, "sd0"}, + {"vfs.dev.read.operations[*]" ,VFS_DEV_READ_OPERATIONS, 0, "sd0"}, + {"vfs.dev.write.bytes[*]" ,VFS_DEV_WRITE_BYTES, 0, "sd0"}, + {"vfs.dev.write.operations[*]" ,VFS_DEV_WRITE_OPERATIONS, 0, "sd0"}, + {"system.cpu.idle1" ,SYSTEM_CPU_IDLE1, 0, 0}, {"system.cpu.idle5" ,SYSTEM_CPU_IDLE5, 0, 0}, {"system.cpu.idle15" ,SYSTEM_CPU_IDLE15, 0, 0}, @@ -266,53 +283,27 @@ COMMAND parameters_specific[]= {"system.cpu.util[*]" ,SYSTEM_CPU_UTILIZATION, 0, "idle"}, - {"net.if.ibytes1[*]" ,NET_IF_IBYTES1, 0, "lo"}, - {"net.if.ibytes5[*]" ,NET_IF_IBYTES5, 0, "lo"}, - {"net.if.ibytes15[*]" ,NET_IF_IBYTES15, 0, "lo"}, - {"net.if.obytes1[*]" ,NET_IF_OBYTES1, 0, "lo"}, - {"net.if.obytes5[*]" ,NET_IF_OBYTES5, 0, "lo"}, - {"net.if.obytes15[*]" ,NET_IF_OBYTES15, 0, "lo"}, + {"net.if.ibytes1[*]" ,NET_IF_IBYTES1, 0, "hme0"}, + {"net.if.ibytes5[*]" ,NET_IF_IBYTES5, 0, "hme0"}, + {"net.if.ibytes15[*]" ,NET_IF_IBYTES15, 0, "hme0"}, + {"net.if.obytes1[*]" ,NET_IF_OBYTES1, 0, "hme0"}, + {"net.if.obytes5[*]" ,NET_IF_OBYTES5, 0, "hme0"}, + {"net.if.obytes15[*]" ,NET_IF_OBYTES15, 0, "hme0"}, + + {"net.if.in.bytes[*]" ,NET_IF_IN_BYTES, 0, "hme0"}, + {"net.if.in.packets[*]" ,NET_IF_IN_PACKETS, 0, "hme0"}, + {"net.if.in.errors[*]" ,NET_IF_IN_ERRORS, 0, "hme0"}, + + {"net.if.out.bytes[*]" ,NET_IF_OUT_BYTES, 0, "hme0"}, + {"net.if.out.packets[*]" ,NET_IF_OUT_PACKETS, 0, "hme0"}, + {"net.if.out.errors[*]" ,NET_IF_OUT_ERRORS, 0, "hme0"}, + + {"net.if.collisions[*]" ,NET_IF_COLLISIONS, 0, "hme0"}, {"net.listen.tcp[*]" ,NET_TCP_LISTEN, 0, "80"}, /* {"tcp_count" ,EXECUTE, 0, "netstat -tn|grep EST|wc -l"}, */ - {"net[listen_23]" ,NET_TCP_LISTEN, 0, "23"}, - {"net[listen_80]" ,NET_TCP_LISTEN, 0, "80"}, - - {"net.in.load[*]" ,NET_IN_LOAD, 0, "hme0"}, - {"net.in.pack[*]" ,NET_IN_PACKETS, 0, "hme0"}, - {"net.in.err[*]" ,NET_IN_ERRORS, 0, "hme0"}, - - {"net.out.load[*]" ,NET_OUT_LOAD, 0, "hme0"}, - {"net.out.pack[*]" ,NET_OUT_PACKETS, 0, "hme0"}, - {"net.out.err[*]" ,NET_OUT_ERRORS, 0, "hme0"}, - - {"net.out.coll[*]" ,NET_COLLISIONS, 0, "hme0"}, - - {"disk_read_ops1[*]" ,DISKREADOPS1, 0, "hda"}, - {"disk_read_ops5[*]" ,DISKREADOPS5, 0, "hda"}, - {"disk_read_ops15[*]" ,DISKREADOPS15, 0, "hda"}, - - {"disk_read_blks1[*]" ,DISKREADBLKS1, 0, "hda"}, - {"disk_read_blks5[*]" ,DISKREADBLKS5, 0, "hda"}, - {"disk_read_blks15[*]" ,DISKREADBLKS15, 0, "hda"}, - - {"disk_write_ops1[*]" ,DISKWRITEOPS1, 0, "hda"}, - {"disk_write_ops5[*]" ,DISKWRITEOPS5, 0, "hda"}, - {"disk_write_ops15[*]" ,DISKWRITEOPS15, 0, "hda"}, - - {"disk_write_blks1[*]" ,DISKWRITEBLKS1, 0, "hda"}, - {"disk_write_blks5[*]" ,DISKWRITEBLKS5, 0, "hda"}, - {"disk_write_blks15[*]" ,DISKWRITEBLKS15, 0, "hda"}, - - {"disk_read_ops[*]" ,DISKREADOPS, 0, "sd0"}, - {"disk_read_kbs[*]" ,DISKREADBLOCKS, 0, "sd0"}, - {"disk_write_ops[*]" ,DISKWRITEOPS, 0, "sd0"}, - {"disk_write_kbs[*]" ,DISKWRITEBLOCKS, 0, "sd0"}, - {"disk_busy[*]" ,DISKBUSY, 0, "sd0"}, - {"disk_svc[*]" ,DISKSVC, 0, "sd0"}, - {"sensor[temp1]" ,SENSOR_TEMP1, 0, 0}, {"sensor[temp2]" ,SENSOR_TEMP2, 0, 0}, {"sensor[temp3]" ,SENSOR_TEMP3, 0, 0}, |