.f_json_print = json_print_net_icmp_stats,
.f_svg_print = svg_print_net_icmp_stats,
.f_raw_print = raw_print_net_icmp_stats,
+ .f_pcp_print = pcp_print_net_icmp_stats,
.f_count_new = NULL,
.item_list = NULL,
.desc = "ICMPv4 traffic statistics",
.f_json_print = json_print_net_eicmp_stats,
.f_svg_print = svg_print_net_eicmp_stats,
.f_raw_print = raw_print_net_eicmp_stats,
+ .f_pcp_print = pcp_print_net_eicmp_stats,
.f_count_new = NULL,
.item_list = NULL,
.desc = "ICMPv4 traffic errors statistics",
pmiUnits(0, -1, 1, 0, PM_TIME_SEC, PM_COUNT_ONE));
#endif /* HAVE_PCP */
}
+
+/*
+ ***************************************************************************
+ * Define PCP metrics for ICMP network statistics.
+ ***************************************************************************
+ */
+void pcp_def_net_icmp_metrics(void)
+{
+#ifdef HAVE_PCP
+ pmiAddMetric("network.snmp.icmp.icmpInMsgs",
+ 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.icmp.icmpOutMsgs",
+ 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.icmp.icmpInEchos",
+ 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.icmp.icmpInEchoReps",
+ 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.icmp.icmpOutEchos",
+ 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.icmp.icmpOutEchoReps",
+ 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.icmp.icmpInTimestamps",
+ 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.icmp.icmpInTimestampReps",
+ 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.icmp.icmpOutTimestamps",
+ 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.icmp.icmpOutTimestampReps",
+ 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.icmp.icmpInAddrMasks",
+ 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.icmp.icmpInAddrMaskReps",
+ 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.icmp.icmpOutAddrMasks",
+ 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.icmp.icmpOutAddrMaskReps",
+ 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 ICMP network errors statistics.
+ ***************************************************************************
+ */
+void pcp_def_net_eicmp_metrics(void)
+{
+#ifdef HAVE_PCP
+ pmiAddMetric("network.snmp.icmp.icmpInErrors",
+ 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.icmp.icmpOutErrors",
+ 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.icmp.icmpInDestUnreachs",
+ 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.icmp.icmpOutDestUnreachs",
+ 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.icmp.icmpInTimeExcds",
+ 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.icmp.icmpOutTimeExcds",
+ 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.icmp.icmpInParmProbs",
+ 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.icmp.icmpOutParmProbs",
+ 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.icmp.icmpInSrcQuenchs",
+ 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.icmp.icmpOutSrcQuenchs",
+ 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.icmp.icmpInRedirects",
+ 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.icmp.icmpOutRedirects",
+ 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_nfsd_metrics(void);
void pcp_def_net_ip_metrics(void);
void pcp_def_net_eip_metrics(void);
+void pcp_def_net_icmp_metrics(void);
+void pcp_def_net_eicmp_metrics(void);
/* Define domains number */
#define PM_INDOM_CPU 0
pmiPutValue("network.snmp.ip.ipFragFails", NULL, buf);
#endif /* HAVE_PCP */
}
+
+/*
+ ***************************************************************************
+ * Display ICMP 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_icmp_stats(struct activity *a, int curr, unsigned long long itv,
+ struct record_header *record_hdr)
+{
+#ifdef HAVE_PCP
+ char buf[64];
+ struct stats_net_icmp
+ *snic = (struct stats_net_icmp *) a->buf[curr],
+ *snip = (struct stats_net_icmp *) a->buf[!curr];
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(snip->InMsgs, snic->InMsgs, itv));
+ pmiPutValue("network.snmp.icmp.icmpInMsgs", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(snip->OutMsgs, snic->OutMsgs, itv));
+ pmiPutValue("network.snmp.icmp.icmpOutMsgs", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(snip->InEchos, snic->InEchos, itv));
+ pmiPutValue("network.snmp.icmp.icmpInEchos", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(snip->InEchoReps, snic->InEchoReps, itv));
+ pmiPutValue("network.snmp.icmp.icmpInEchoReps", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(snip->OutEchos, snic->OutEchos, itv));
+ pmiPutValue("network.snmp.icmp.icmpOutEchos", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(snip->OutEchoReps, snic->OutEchoReps, itv));
+ pmiPutValue("network.snmp.icmp.icmpOutEchoReps", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(snip->InTimestamps, snic->InTimestamps, itv));
+ pmiPutValue("network.snmp.icmp.icmpInTimestamps", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(snip->InTimestampReps, snic->InTimestampReps, itv));
+ pmiPutValue("network.snmp.icmp.icmpInTimestampReps", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(snip->OutTimestamps, snic->OutTimestamps, itv));
+ pmiPutValue("network.snmp.icmp.icmpOutTimestamps", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(snip->OutTimestampReps, snic->OutTimestampReps, itv));
+ pmiPutValue("network.snmp.icmp.icmpOutTimestampReps", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(snip->InAddrMasks, snic->InAddrMasks, itv));
+ pmiPutValue("network.snmp.icmp.icmpInAddrMasks", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(snip->InAddrMaskReps, snic->InAddrMaskReps, itv));
+ pmiPutValue("network.snmp.icmp.icmpInAddrMaskReps", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(snip->OutAddrMasks, snic->OutAddrMasks, itv));
+ pmiPutValue("network.snmp.icmp.icmpOutAddrMasks", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(snip->OutAddrMaskReps, snic->OutAddrMaskReps, itv));
+ pmiPutValue("network.snmp.icmp.icmpOutAddrMaskReps", NULL, buf);
+#endif /* HAVE_PCP */
+}
+
+
+/*
+ ***************************************************************************
+ * Display ICMP 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_eicmp_stats(struct activity *a, int curr, unsigned long long itv,
+ struct record_header *record_hdr)
+{
+#ifdef HAVE_PCP
+ char buf[64];
+ struct stats_net_eicmp
+ *sneic = (struct stats_net_eicmp *) a->buf[curr],
+ *sneip = (struct stats_net_eicmp *) a->buf[!curr];
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(sneip->InErrors, sneic->InErrors, itv));
+ pmiPutValue("network.snmp.icmp.icmpInErrors", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(sneip->OutErrors, sneic->OutErrors, itv));
+ pmiPutValue("network.snmp.icmp.icmpOutErrors", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(sneip->InDestUnreachs, sneic->InDestUnreachs, itv));
+ pmiPutValue("network.snmp.icmp.icmpInDestUnreachs", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(sneip->OutDestUnreachs, sneic->OutDestUnreachs, itv));
+ pmiPutValue("network.snmp.icmp.icmpOutDestUnreachs", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(sneip->InTimeExcds, sneic->InTimeExcds, itv));
+ pmiPutValue("network.snmp.icmp.icmpInTimeExcds", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(sneip->OutTimeExcds, sneic->OutTimeExcds, itv));
+ pmiPutValue("network.snmp.icmp.icmpOutTimeExcds", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(sneip->InParmProbs, sneic->InParmProbs, itv));
+ pmiPutValue("network.snmp.icmp.icmpInParmProbs", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(sneip->OutParmProbs, sneic->OutParmProbs, itv));
+ pmiPutValue("network.snmp.icmp.icmpOutParmProbs", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(sneip->InSrcQuenchs, sneic->InSrcQuenchs, itv));
+ pmiPutValue("network.snmp.icmp.icmpInSrcQuenchs", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(sneip->OutSrcQuenchs, sneic->OutSrcQuenchs, itv));
+ pmiPutValue("network.snmp.icmp.icmpOutSrcQuenchs", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(sneip->InRedirects, sneic->InRedirects, itv));
+ pmiPutValue("network.snmp.icmp.icmpInRedirects", NULL, buf);
+
+ snprintf(buf, sizeof(buf), "%f",
+ S_VALUE(sneip->OutRedirects, sneic->OutRedirects, itv));
+ pmiPutValue("network.snmp.icmp.icmpOutRedirects", NULL, buf);
+#endif /* HAVE_PCP */
+}
(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 *);
+__print_funct_t pcp_print_net_icmp_stats
+ (struct activity *, int, unsigned long long, struct record_header *);
+__print_funct_t pcp_print_net_eicmp_stats
+ (struct activity *, int, unsigned long long, struct record_header *);
#endif /* _PCP_STATS_H */
case A_NET_EIP:
pcp_def_net_eip_metrics();
break;
+
+ case A_NET_ICMP:
+ pcp_def_net_icmp_metrics();
+ break;
+
+ case A_NET_EICMP:
+ pcp_def_net_eicmp_metrics();
+ break;
}
}
}