.f_json_print = json_print_net_ip6_stats,
.f_svg_print = svg_print_net_ip6_stats,
.f_raw_print = raw_print_net_ip6_stats,
+ .f_pcp_print = pcp_print_net_ip6_stats,
.f_count_new = NULL,
.item_list = NULL,
.desc = "IPv6 traffic statistics",
.f_json_print = json_print_net_eip6_stats,
.f_svg_print = svg_print_net_eip6_stats,
.f_raw_print = raw_print_net_eip6_stats,
+ .f_pcp_print = pcp_print_net_eip6_stats,
.f_count_new = NULL,
.item_list = NULL,
.desc = "IPv6 traffic errors statistics",
pmiUnits(0, -1, 1, 0, PM_TIME_SEC, PM_COUNT_ONE));
#endif /* HAVE_PCP */
}
+
+/*
+ ***************************************************************************
+ * Define PCP metrics for IPv6 network statistics.
+ ***************************************************************************
+ */
+void pcp_def_net_ip6_metrics(void)
+{
+#ifdef HAVE_PCP
+ pmiAddMetric("network.snmp.ip6.ipv6IfStatsInReceives",
+ 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.ip6.ipv6IfStatsOutForwDatagrams",
+ 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.ip6.ipv6IfStatsInDelivers",
+ 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.ip6.ipv6IfStatsOutRequests",
+ 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.ip6.ipv6IfStatsReasmReqds",
+ 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.ip6.ipv6IfStatsReasmOKs",
+ 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.ip6.ipv6IfStatsInMcastPkts",
+ 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.ip6.ipv6IfStatsOutMcastPkts",
+ 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.ip6.ipv6IfStatsOutFragOKs",
+ 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.ip6.ipv6IfStatsOutFragCreates",
+ 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 IPv6 network errors statistics.
+ ***************************************************************************
+ */
+void pcp_def_net_eip6_metrics(void)
+{
+#ifdef HAVE_PCP
+ pmiAddMetric("network.snmp.ip6.ipv6IfStatsInHdrErrors",
+ 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.ip6.ipv6IfStatsInAddrErrors",
+ 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.ip6.ipv6IfStatsInUnknownProtos",
+ 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.ip6.ipv6IfStatsInTooBigErrors",
+ 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.ip6.ipv6IfStatsInDiscards",
+ 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.ip6.ipv6IfStatsOutDiscards",
+ 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.ip6.ipv6IfStatsInNoRoutes",
+ 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.ip6.ipv6IfStatsOutNoRoutes",
+ 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.ip6.ipv6IfStatsReasmFails",
+ 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.ip6.ipv6IfStatsOutFragFails",
+ 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.ip6.ipv6IfStatsInTruncatedPkts",
+ 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_tcp_metrics(void);
void pcp_def_net_etcp_metrics(void);
void pcp_def_net_udp_metrics(void);
+void pcp_def_net_ip6_metrics(void);
+void pcp_def_net_eip6_metrics(void);
/* Define domains number */
#define PM_INDOM_CPU 0
pmiPutValue("network.snmp.udp.udpInErrors", NULL, buf);
#endif /* HAVE_PCP */
}
+
+/*
+ ***************************************************************************
+ * Display IPv6 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_ip6_stats(struct activity *a, int curr, unsigned long long itv,
+ struct record_header *record_hdr)
+{
+#ifdef HAVE_PCP
+ char buf[64];
+ struct stats_net_ip6
+ *snic = (struct stats_net_ip6 *) a->buf[curr],
+ *snip = (struct stats_net_ip6 *) a->buf[!curr];
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(snip->InReceives6, snic->InReceives6, itv));
+ pmiPutValue("network.snmp.ip6.ipv6IfStatsInReceives", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(snip->OutForwDatagrams6, snic->OutForwDatagrams6, itv));
+ pmiPutValue("network.snmp.ip6.ipv6IfStatsOutForwDatagrams", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(snip->InDelivers6, snic->InDelivers6, itv));
+ pmiPutValue("network.snmp.ip6.ipv6IfStatsInDelivers", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(snip->OutRequests6, snic->OutRequests6, itv));
+ pmiPutValue("network.snmp.ip6.ipv6IfStatsOutRequests", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(snip->ReasmReqds6, snic->ReasmReqds6, itv));
+ pmiPutValue("network.snmp.ip6.ipv6IfStatsReasmReqds", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(snip->ReasmOKs6, snic->ReasmOKs6, itv));
+ pmiPutValue("network.snmp.ip6.ipv6IfStatsReasmOKs", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(snip->InMcastPkts6, snic->InMcastPkts6, itv));
+ pmiPutValue("network.snmp.ip6.ipv6IfStatsInMcastPkts", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(snip->OutMcastPkts6, snic->OutMcastPkts6, itv));
+ pmiPutValue("network.snmp.ip6.ipv6IfStatsOutMcastPkts", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(snip->FragOKs6, snic->FragOKs6, itv));
+ pmiPutValue("network.snmp.ip6.ipv6IfStatsOutFragOKs", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(snip->FragCreates6, snic->FragCreates6, itv));
+ pmiPutValue("network.snmp.ip6.ipv6IfStatsOutFragCreates", NULL, buf);
+#endif /* HAVE_PCP */
+}
+
+/*
+ ***************************************************************************
+ * Display IPv6 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_eip6_stats(struct activity *a, int curr, unsigned long long itv,
+ struct record_header *record_hdr)
+{
+#ifdef HAVE_PCP
+ char buf[64];
+ struct stats_net_eip6
+ *sneic = (struct stats_net_eip6 *) a->buf[curr],
+ *sneip = (struct stats_net_eip6 *) a->buf[!curr];
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(sneip->InHdrErrors6, sneic->InHdrErrors6, itv));
+ pmiPutValue("network.snmp.ip6.ipv6IfStatsInHdrErrors", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(sneip->InAddrErrors6, sneic->InAddrErrors6, itv));
+ pmiPutValue("network.snmp.ip6.ipv6IfStatsInAddrErrors", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(sneip->InUnknownProtos6, sneic->InUnknownProtos6, itv));
+ pmiPutValue("network.snmp.ip6.ipv6IfStatsInUnknownProtos", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(sneip->InTooBigErrors6, sneic->InTooBigErrors6, itv));
+ pmiPutValue("network.snmp.ip6.ipv6IfStatsInTooBigErrors", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(sneip->InDiscards6, sneic->InDiscards6, itv));
+ pmiPutValue("network.snmp.ip6.ipv6IfStatsInDiscards", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(sneip->OutDiscards6, sneic->OutDiscards6, itv));
+ pmiPutValue("network.snmp.ip6.ipv6IfStatsOutDiscards", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(sneip->InNoRoutes6, sneic->InNoRoutes6, itv));
+ pmiPutValue("network.snmp.ip6.ipv6IfStatsInNoRoutes", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(sneip->OutNoRoutes6, sneic->OutNoRoutes6, itv));
+ pmiPutValue("network.snmp.ip6.ipv6IfStatsOutNoRoutes", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(sneip->ReasmFails6, sneic->ReasmFails6, itv));
+ pmiPutValue("network.snmp.ip6.ipv6IfStatsReasmFails", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(sneip->FragFails6, sneic->FragFails6, itv));
+ pmiPutValue("network.snmp.ip6.ipv6IfStatsOutFragFails", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(sneip->InTruncatedPkts6, sneic->InTruncatedPkts6, itv));
+ pmiPutValue("network.snmp.ip6.ipv6IfStatsInTruncatedPkts", NULL, buf);
+#endif /* HAVE_PCP */
+}
(struct activity *, int, unsigned long long, struct record_header *);
__print_funct_t pcp_print_net_udp_stats
(struct activity *, int, unsigned long long, struct record_header *);
+__print_funct_t pcp_print_net_ip6_stats
+ (struct activity *, int, unsigned long long, struct record_header *);
+__print_funct_t pcp_print_net_eip6_stats
+ (struct activity *, int, unsigned long long, struct record_header *);
#endif /* _PCP_STATS_H */
case A_NET_UDP:
pcp_def_net_udp_metrics();
break;
+
+ case A_NET_IP6:
+ pcp_def_net_ip6_metrics();
+ break;
+
+ case A_NET_EIP6:
+ pcp_def_net_eip6_metrics();
+ break;
}
}
}