diff --git a/server.cpp b/server.cpp index 659b15d..d654f5b 100644 --- a/server.cpp +++ b/server.cpp @@ -566,18 +566,21 @@ void server::handler() if (ifr != IFR_OK && ifr != IFR_CONNECTION) { // something wrong with the received PDU? DOLOG(logging::ll_debug, "server::handler", endpoint, "invalid PDU"); - is->iscsiInstSsnFormatErrors++; - std::optional reason; - if (ifr == IFR_INVALID_FIELD || ifr == IFR_IO_ERROR || ifr == IFR_MISC) + if (ifr == IFR_INVALID_FIELD || ifr == IFR_IO_ERROR || ifr == IFR_MISC) { + is->iscsiInstSsnFormatErrors++; reason = 0x09; - else if (ifr == IFR_DIGEST) + } + else if (ifr == IFR_DIGEST) { + is->iscsiInstSsnDigestErrors++; reason = 0x02; + } else if (ifr == IFR_INVALID_COMMAND) reason = 0x05; - else + else { DOLOG(logging::ll_error, "server::handler", endpoint, "internal error, IFR %d not known", ifr); + } std::optional reject = generate_reject_pdu(*pdu, reason); if (reject.has_value() == false) { diff --git a/server.h b/server.h index 58c5f4e..747f4fc 100644 --- a/server.h +++ b/server.h @@ -11,6 +11,7 @@ typedef struct uint32_t iscsiSsnCmdPDUs; // 1.3.6.1.2.1.142.1.10.2.1.1 uint32_t iscsiInstSsnFailures; // 1.3.6.1.2.1.142.1.1.1.1.10 uint32_t iscsiInstSsnFormatErrors; // 1.3.6.1.2.1.142.1.1.2.1.3 + uint32_t iscsiInstSsnDigestErrors; // 1.3.6.1.2.1.142.1.1.2.1.1 uint64_t iscsiSsnTxDataOctets; // 1.3.6.1.2.1.142.1.10.2.1.3 uint64_t iscsiSsnRxDataOctets; // 1.3.6.1.2.1.142.1.10.2.1.4 uint32_t iscsiTgtLoginAccepts; // 1.3.6.1.2.1.142.1.6.2.1.1 diff --git a/snmp.cpp b/snmp.cpp index e2a5a93..aa176d0 100644 --- a/snmp.cpp +++ b/snmp.cpp @@ -34,6 +34,7 @@ void init_snmp(snmp **const snmp_, snmp_data **const snmp_data_, io_stats_t *con (*snmp_data_)->register_oid("1.3.6.1.2.1.142.1.10.2.1.1", new snmp_data_type_stats_uint32_t(&is->iscsiSsnCmdPDUs)); (*snmp_data_)->register_oid("1.3.6.1.2.1.142.1.6.2.1.1", new snmp_data_type_stats_uint32_t(&is->iscsiTgtLoginAccepts)); (*snmp_data_)->register_oid("1.3.6.1.2.1.142.1.6.3.1.1", new snmp_data_type_stats_uint32_t(&is->iscsiTgtLogoutNormals)); + (*snmp_data_)->register_oid("1.3.6.1.2.1.142.1.1.2.1.1", new snmp_data_type_stats_uint32_t(&is->iscsiInstSsnDigestErrors)); (*snmp_data_)->register_oid("1.3.6.1.2.1.142.1.10.2.1.3", new snmp_data_type_stats(snmp_integer::snmp_integer_type::si_counter64, &is->iscsiSsnTxDataOctets)); (*snmp_data_)->register_oid("1.3.6.1.2.1.142.1.10.2.1.4", new snmp_data_type_stats(snmp_integer::snmp_integer_type::si_counter64, &is->iscsiSsnRxDataOctets)); (*snmp_data_)->register_oid("1.3.6.1.2.1.142.1.1.2.1.3", new snmp_data_type_stats_uint32_t(&is->iscsiInstSsnFormatErrors));