.f_json_print = json_print_net_ip_stats,
.f_svg_print = svg_print_net_ip_stats,
.f_raw_print = raw_print_net_ip_stats,
+ .f_pcp_print = pcp_print_net_ip_stats,
.f_count_new = NULL,
.item_list = NULL,
.desc = "IPv4 traffic statistics",
.f_json_print = json_print_net_eip_stats,
.f_svg_print = svg_print_net_eip_stats,
.f_raw_print = raw_print_net_eip_stats,
+ .f_pcp_print = pcp_print_net_eip_stats,
.f_count_new = NULL,
.item_list = NULL,
.desc = "IPv4 traffic errors statistics",
pmiUnits(0, -1, 1, 0, PM_TIME_SEC, PM_COUNT_ONE));
#endif /* HAVE_PCP */
}
+
+/*
+ ***************************************************************************
+ * Define PCP metrics for IP network statistics.
+ ***************************************************************************
+ */
+void pcp_def_net_ip_metrics(void)
+{
+#ifdef HAVE_PCP
+ pmiAddMetric("network.snmp.ip.ipInReceives",
+ PM_IN_NULL, PM_TYPE_FLOAT, PM_INDOM_NULL, PM_SEM_INSTANT,
+ pmiUnits(0, -1, 1, 0, PM_TIME_SEC, PM_COUNT_ONE));
+
+ pmiAddMetric("network.snmp.ip.ipForwDatagrams",
+ PM_IN_NULL, PM_TYPE_FLOAT, PM_INDOM_NULL, PM_SEM_INSTANT,
+ pmiUnits(0, -1, 1, 0, PM_TIME_SEC, PM_COUNT_ONE));
+
+ pmiAddMetric("network.snmp.ip.ipInDelivers",
+ PM_IN_NULL, PM_TYPE_FLOAT, PM_INDOM_NULL, PM_SEM_INSTANT,
+ pmiUnits(0, -1, 1, 0, PM_TIME_SEC, PM_COUNT_ONE));
+
+ pmiAddMetric("network.snmp.ip.ipOutRequests",
+ PM_IN_NULL, PM_TYPE_FLOAT, PM_INDOM_NULL, PM_SEM_INSTANT,
+ pmiUnits(0, -1, 1, 0, PM_TIME_SEC, PM_COUNT_ONE));
+
+ pmiAddMetric("network.snmp.ip.ipReasmReqds",
+ PM_IN_NULL, PM_TYPE_FLOAT, PM_INDOM_NULL, PM_SEM_INSTANT,
+ pmiUnits(0, -1, 1, 0, PM_TIME_SEC, PM_COUNT_ONE));
+
+ pmiAddMetric("network.snmp.ip.ipReasmOKs",
+ PM_IN_NULL, PM_TYPE_FLOAT, PM_INDOM_NULL, PM_SEM_INSTANT,
+ pmiUnits(0, -1, 1, 0, PM_TIME_SEC, PM_COUNT_ONE));
+
+ pmiAddMetric("network.snmp.ip.ipFragOKs",
+ PM_IN_NULL, PM_TYPE_FLOAT, PM_INDOM_NULL, PM_SEM_INSTANT,
+ pmiUnits(0, -1, 1, 0, PM_TIME_SEC, PM_COUNT_ONE));
+
+ pmiAddMetric("network.snmp.ip.ipFragCreates",
+ PM_IN_NULL, PM_TYPE_FLOAT, PM_INDOM_NULL, PM_SEM_INSTANT,
+ pmiUnits(0, -1, 1, 0, PM_TIME_SEC, PM_COUNT_ONE));
+#endif /* HAVE_PCP */
+}
+
+/*
+ ***************************************************************************
+ * Define PCP metrics for IP network errors statistics.
+ ***************************************************************************
+ */
+void pcp_def_net_eip_metrics(void)
+{
+#ifdef HAVE_PCP
+ pmiAddMetric("network.snmp.ip.ipInHdrErrors",
+ PM_IN_NULL, PM_TYPE_FLOAT, PM_INDOM_NULL, PM_SEM_INSTANT,
+ pmiUnits(0, -1, 1, 0, PM_TIME_SEC, PM_COUNT_ONE));
+
+ pmiAddMetric("network.snmp.ip.ipInAddrErrors",
+ PM_IN_NULL, PM_TYPE_FLOAT, PM_INDOM_NULL, PM_SEM_INSTANT,
+ pmiUnits(0, -1, 1, 0, PM_TIME_SEC, PM_COUNT_ONE));
+
+ pmiAddMetric("network.snmp.ip.ipInUnknownProtos",
+ PM_IN_NULL, PM_TYPE_FLOAT, PM_INDOM_NULL, PM_SEM_INSTANT,
+ pmiUnits(0, -1, 1, 0, PM_TIME_SEC, PM_COUNT_ONE));
+
+ pmiAddMetric("network.snmp.ip.ipInDiscards",
+ PM_IN_NULL, PM_TYPE_FLOAT, PM_INDOM_NULL, PM_SEM_INSTANT,
+ pmiUnits(0, -1, 1, 0, PM_TIME_SEC, PM_COUNT_ONE));
+
+ pmiAddMetric("network.snmp.ip.ipOutDiscards",
+ PM_IN_NULL, PM_TYPE_FLOAT, PM_INDOM_NULL, PM_SEM_INSTANT,
+ pmiUnits(0, -1, 1, 0, PM_TIME_SEC, PM_COUNT_ONE));
+
+ pmiAddMetric("network.snmp.ip.ipOutNoRoutes",
+ PM_IN_NULL, PM_TYPE_FLOAT, PM_INDOM_NULL, PM_SEM_INSTANT,
+ pmiUnits(0, -1, 1, 0, PM_TIME_SEC, PM_COUNT_ONE));
+
+ pmiAddMetric("network.snmp.ip.ipReasmFails",
+ PM_IN_NULL, PM_TYPE_FLOAT, PM_INDOM_NULL, PM_SEM_INSTANT,
+ pmiUnits(0, -1, 1, 0, PM_TIME_SEC, PM_COUNT_ONE));
+
+ pmiAddMetric("network.snmp.ip.ipFragFails",
+ PM_IN_NULL, PM_TYPE_FLOAT, PM_INDOM_NULL, PM_SEM_INSTANT,
+ pmiUnits(0, -1, 1, 0, PM_TIME_SEC, PM_COUNT_ONE));
+#endif /* HAVE_PCP */
+}
void pcp_def_net_dev_metrics(struct activity *);
void pcp_def_net_nfs_metrics(void);
void pcp_def_net_nfsd_metrics(void);
+void pcp_def_net_ip_metrics(void);
+void pcp_def_net_eip_metrics(void);
/* Define domains number */
#define PM_INDOM_CPU 0
pmiPutValue("network.fs.server.getattr", NULL, buf);
#endif /* HAVE_PCP */
}
+
+/*
+ ***************************************************************************
+ * Display IP network statistics in PCP format.
+ *
+ * IN:
+ * @a Activity structure with statistics.
+ * @curr Index in array for current sample statistics.
+ * @itv Interval of time in 1/100th of a second.
+ * @record_hdr Record header for current sample.
+ ***************************************************************************
+ */
+__print_funct_t pcp_print_net_ip_stats(struct activity *a, int curr, unsigned long long itv,
+ struct record_header *record_hdr)
+{
+#ifdef HAVE_PCP
+ char buf[64];
+ struct stats_net_ip
+ *snic = (struct stats_net_ip *) a->buf[curr],
+ *snip = (struct stats_net_ip *) a->buf[!curr];
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(snip->InReceives, snic->InReceives, itv));
+ pmiPutValue("network.snmp.ip.ipInReceives", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(snip->ForwDatagrams, snic->ForwDatagrams, itv));
+ pmiPutValue("network.snmp.ip.ipForwDatagrams", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(snip->InDelivers, snic->InDelivers, itv));
+ pmiPutValue("network.snmp.ip.ipInDelivers", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(snip->OutRequests, snic->OutRequests, itv));
+ pmiPutValue("network.snmp.ip.ipOutRequests", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(snip->ReasmReqds, snic->ReasmReqds, itv));
+ pmiPutValue("network.snmp.ip.ipReasmReqds", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(snip->ReasmOKs, snic->ReasmOKs, itv));
+ pmiPutValue("network.snmp.ip.ipReasmOKs", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(snip->FragOKs, snic->FragOKs, itv));
+ pmiPutValue("network.snmp.ip.ipFragOKs", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(snip->FragCreates, snic->FragCreates, itv));
+ pmiPutValue("network.snmp.ip.ipFragCreates", NULL, buf);
+#endif /* HAVE_PCP */
+}
+
+/*
+ ***************************************************************************
+ * Display IP network errors statistics in PCP format.
+ *
+ * IN:
+ * @a Activity structure with statistics.
+ * @curr Index in array for current sample statistics.
+ * @itv Interval of time in 1/100th of a second.
+ * @record_hdr Record header for current sample.
+ ***************************************************************************
+ */
+__print_funct_t pcp_print_net_eip_stats(struct activity *a, int curr, unsigned long long itv,
+ struct record_header *record_hdr)
+{
+#ifdef HAVE_PCP
+ char buf[64];
+ struct stats_net_eip
+ *sneic = (struct stats_net_eip *) a->buf[curr],
+ *sneip = (struct stats_net_eip *) a->buf[!curr];
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(sneip->InHdrErrors, sneic->InHdrErrors, itv));
+ pmiPutValue("network.snmp.ip.ipInHdrErrors", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(sneip->InAddrErrors, sneic->InAddrErrors, itv));
+ pmiPutValue("network.snmp.ip.ipInAddrErrors", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(sneip->InUnknownProtos, sneic->InUnknownProtos, itv));
+ pmiPutValue("network.snmp.ip.ipInUnknownProtos", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(sneip->InDiscards, sneic->InDiscards, itv));
+ pmiPutValue("network.snmp.ip.ipInDiscards", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(sneip->OutDiscards, sneic->OutDiscards, itv));
+ pmiPutValue("network.snmp.ip.ipOutDiscards", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(sneip->OutNoRoutes, sneic->OutNoRoutes, itv));
+ pmiPutValue("network.snmp.ip.ipOutNoRoutes", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(sneip->ReasmFails, sneic->ReasmFails, itv));
+ pmiPutValue("network.snmp.ip.ipReasmFails", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(sneip->FragFails, sneic->FragFails, itv));
+ pmiPutValue("network.snmp.ip.ipFragFails", NULL, buf);
+#endif /* HAVE_PCP */
+}
(struct activity *, int, unsigned long long, struct record_header *);
__print_funct_t pcp_print_net_nfsd_stats
(struct activity *, int, unsigned long long, struct record_header *);
+__print_funct_t pcp_print_net_ip_stats
+ (struct activity *, int, unsigned long long, struct record_header *);
+__print_funct_t pcp_print_net_eip_stats
+ (struct activity *, int, unsigned long long, struct record_header *);
#endif /* _PCP_STATS_H */
case A_NET_NFSD:
pcp_def_net_nfsd_metrics();
break;
+
+ case A_NET_IP:
+ pcp_def_net_ip_metrics();
+ break;
+
+ case A_NET_EIP:
+ pcp_def_net_eip_metrics();
+ break;
}
}
}