Blame SOURCES/0002-Ticket-49546-Fix-issues-with-MIB-file.patch

edc5f2
From 9f1bbff43c3e6ec01e60d35082b21b83a8795dc2 Mon Sep 17 00:00:00 2001
edc5f2
From: Mark Reynolds <mreynolds@redhat.com>
edc5f2
Date: Thu, 12 Jul 2018 10:48:11 -0400
edc5f2
Subject: [PATCH] Ticket 49546 - Fix issues with MIB file
edc5f2
edc5f2
Description:  Change dsMaxThreadsHit to dsMaxThreadsHits, and set the
edc5f2
              proper object type for dsIntIndex
edc5f2
edc5f2
https://pagure.io/389-ds-base/issue/49546
edc5f2
edc5f2
Reviewed by: spichugi & firstyear(Thanks!!)
edc5f2
edc5f2
(cherry picked from commit 6d4caac04be4223971de54d292db82734f6d6a44)
edc5f2
---
edc5f2
 ldap/servers/slapd/agtmmap.c           | 2 +-
edc5f2
 ldap/servers/slapd/agtmmap.h           | 2 +-
edc5f2
 ldap/servers/slapd/connection.c        | 2 +-
edc5f2
 ldap/servers/slapd/slap.h              | 2 +-
edc5f2
 ldap/servers/slapd/snmp_collator.c     | 6 +++---
edc5f2
 ldap/servers/snmp/ldap-agent.c         | 4 ++--
edc5f2
 ldap/servers/snmp/ldap-agent.h         | 2 +-
edc5f2
 ldap/servers/snmp/redhat-directory.mib | 8 ++++----
edc5f2
 8 files changed, 14 insertions(+), 14 deletions(-)
edc5f2
edc5f2
diff --git a/ldap/servers/slapd/agtmmap.c b/ldap/servers/slapd/agtmmap.c
edc5f2
index fbc730db6..352ccefda 100644
edc5f2
--- a/ldap/servers/slapd/agtmmap.c
edc5f2
+++ b/ldap/servers/slapd/agtmmap.c
edc5f2
@@ -298,7 +298,7 @@ agt_mread_stats(int hdl, struct hdr_stats_t *pHdrInfo, struct ops_stats_t *pDsOp
edc5f2
         pDsOpsTbl->dsErrors = pfile_stats->ops_stats.dsErrors;
edc5f2
         pDsOpsTbl->dsConnections = pfile_stats->ops_stats.dsConnections;
edc5f2
         pDsOpsTbl->dsConnectionsInMaxThreads = pfile_stats->ops_stats.dsConnectionsInMaxThreads;
edc5f2
-        pDsOpsTbl->dsMaxThreadsHit = pfile_stats->ops_stats.dsMaxThreadsHit;
edc5f2
+        pDsOpsTbl->dsMaxThreadsHits = pfile_stats->ops_stats.dsMaxThreadsHits;
edc5f2
     }
edc5f2
 
edc5f2
     if (pDsEntTbl != NULL) {
edc5f2
diff --git a/ldap/servers/slapd/agtmmap.h b/ldap/servers/slapd/agtmmap.h
edc5f2
index 2397dad3c..fb27ab2c4 100644
edc5f2
--- a/ldap/servers/slapd/agtmmap.h
edc5f2
+++ b/ldap/servers/slapd/agtmmap.h
edc5f2
@@ -102,7 +102,7 @@ struct ops_stats_t
edc5f2
     uint64_t dsErrors;
edc5f2
     uint64_t dsConnections;             /* Number of currently connected clients */
edc5f2
     uint64_t dsConnectionSeq;           /* Monotonically increasing number bumped on each new conn est */
edc5f2
-    uint64_t dsMaxThreadsHit;           /* Number of times a connection hit max threads */
edc5f2
+    uint64_t dsMaxThreadsHits;          /* Number of times a connection hit max threads */
edc5f2
     uint64_t dsConnectionsInMaxThreads; /* current number of connections that are in max threads */
edc5f2
     uint64_t dsBytesRecv;               /* Count of bytes read from clients */
edc5f2
     uint64_t dsBytesSent;               /* Count of bytes sent to clients */
edc5f2
diff --git a/ldap/servers/slapd/connection.c b/ldap/servers/slapd/connection.c
edc5f2
index 1dbb49f06..188383b97 100644
edc5f2
--- a/ldap/servers/slapd/connection.c
edc5f2
+++ b/ldap/servers/slapd/connection.c
edc5f2
@@ -1911,7 +1911,7 @@ connection_activity(Connection *conn, int maxthreads)
edc5f2
         slapi_counter_increment(max_threads_count);
edc5f2
         slapi_counter_increment(conns_in_maxthreads);
edc5f2
         slapi_counter_increment(g_get_global_snmp_vars()->ops_tbl.dsConnectionsInMaxThreads);
edc5f2
-        slapi_counter_increment(g_get_global_snmp_vars()->ops_tbl.dsMaxThreadsHit);
edc5f2
+        slapi_counter_increment(g_get_global_snmp_vars()->ops_tbl.dsMaxThreadsHits);
edc5f2
     }
edc5f2
     op_stack_obj = connection_get_operation();
edc5f2
     connection_add_operation(conn, op_stack_obj->op);
edc5f2
diff --git a/ldap/servers/slapd/slap.h b/ldap/servers/slapd/slap.h
edc5f2
index eb97cdcc4..a02792648 100644
edc5f2
--- a/ldap/servers/slapd/slap.h
edc5f2
+++ b/ldap/servers/slapd/slap.h
edc5f2
@@ -1889,7 +1889,7 @@ struct snmp_ops_tbl_t
edc5f2
     Slapi_Counter *dsBytesSent;     /* Count of bytes sent to clients */
edc5f2
     Slapi_Counter *dsEntriesReturned;
edc5f2
     Slapi_Counter *dsReferralsReturned;
edc5f2
-    Slapi_Counter *dsMaxThreadsHit;
edc5f2
+    Slapi_Counter *dsMaxThreadsHits;
edc5f2
     Slapi_Counter *dsConnectionsInMaxThreads;
edc5f2
 };
edc5f2
 
edc5f2
diff --git a/ldap/servers/slapd/snmp_collator.c b/ldap/servers/slapd/snmp_collator.c
edc5f2
index d56379466..1da7ccbb2 100644
edc5f2
--- a/ldap/servers/slapd/snmp_collator.c
edc5f2
+++ b/ldap/servers/slapd/snmp_collator.c
edc5f2
@@ -122,7 +122,7 @@ snmp_collator_init(void)
edc5f2
     g_get_global_snmp_vars()->ops_tbl.dsEntriesReturned = slapi_counter_new();
edc5f2
     g_get_global_snmp_vars()->ops_tbl.dsReferralsReturned = slapi_counter_new();
edc5f2
     g_get_global_snmp_vars()->ops_tbl.dsConnectionsInMaxThreads = slapi_counter_new();
edc5f2
-    g_get_global_snmp_vars()->ops_tbl.dsMaxThreadsHit = slapi_counter_new();
edc5f2
+    g_get_global_snmp_vars()->ops_tbl.dsMaxThreadsHits = slapi_counter_new();
edc5f2
     g_get_global_snmp_vars()->entries_tbl.dsMasterEntries = slapi_counter_new();
edc5f2
     g_get_global_snmp_vars()->entries_tbl.dsCopyEntries = slapi_counter_new();
edc5f2
     g_get_global_snmp_vars()->entries_tbl.dsCacheEntries = slapi_counter_new();
edc5f2
@@ -592,7 +592,7 @@ snmp_update_ops_table(void)
edc5f2
     stats->ops_stats.dsConnections = slapi_counter_get_value(g_get_global_snmp_vars()->ops_tbl.dsConnections);
edc5f2
     stats->ops_stats.dsConnectionSeq = slapi_counter_get_value(g_get_global_snmp_vars()->ops_tbl.dsConnectionSeq);
edc5f2
     stats->ops_stats.dsConnectionsInMaxThreads = slapi_counter_get_value(g_get_global_snmp_vars()->ops_tbl.dsConnectionsInMaxThreads);
edc5f2
-    stats->ops_stats.dsMaxThreadsHit = slapi_counter_get_value(g_get_global_snmp_vars()->ops_tbl.dsMaxThreadsHit);
edc5f2
+    stats->ops_stats.dsMaxThreadsHits = slapi_counter_get_value(g_get_global_snmp_vars()->ops_tbl.dsMaxThreadsHits);
edc5f2
     stats->ops_stats.dsBytesRecv = slapi_counter_get_value(g_get_global_snmp_vars()->ops_tbl.dsBytesRecv);
edc5f2
     stats->ops_stats.dsBytesSent = slapi_counter_get_value(g_get_global_snmp_vars()->ops_tbl.dsBytesSent);
edc5f2
     stats->ops_stats.dsEntriesReturned = slapi_counter_get_value(g_get_global_snmp_vars()->ops_tbl.dsEntriesReturned);
edc5f2
@@ -738,7 +738,7 @@ snmp_as_entry(Slapi_Entry *e)
edc5f2
     add_counter_to_value(e, "Connections", slapi_counter_get_value(g_get_global_snmp_vars()->ops_tbl.dsConnections));
edc5f2
     add_counter_to_value(e, "ConnectionSeq", slapi_counter_get_value(g_get_global_snmp_vars()->ops_tbl.dsConnectionSeq));
edc5f2
     add_counter_to_value(e, "ConnectionsInMaxThreads", slapi_counter_get_value(g_get_global_snmp_vars()->ops_tbl.dsConnectionsInMaxThreads));
edc5f2
-    add_counter_to_value(e, "ConnectionsMaxThreadsCount", slapi_counter_get_value(g_get_global_snmp_vars()->ops_tbl.dsMaxThreadsHit));
edc5f2
+    add_counter_to_value(e, "ConnectionsMaxThreadsCount", slapi_counter_get_value(g_get_global_snmp_vars()->ops_tbl.dsMaxThreadsHits));
edc5f2
     add_counter_to_value(e, "BytesRecv", slapi_counter_get_value(g_get_global_snmp_vars()->ops_tbl.dsBytesRecv));
edc5f2
     add_counter_to_value(e, "BytesSent", slapi_counter_get_value(g_get_global_snmp_vars()->ops_tbl.dsBytesSent));
edc5f2
     add_counter_to_value(e, "EntriesReturned", slapi_counter_get_value(g_get_global_snmp_vars()->ops_tbl.dsEntriesReturned));
edc5f2
diff --git a/ldap/servers/snmp/ldap-agent.c b/ldap/servers/snmp/ldap-agent.c
edc5f2
index 4393a8956..bd9b8dd9b 100644
edc5f2
--- a/ldap/servers/snmp/ldap-agent.c
edc5f2
+++ b/ldap/servers/snmp/ldap-agent.c
edc5f2
@@ -496,8 +496,8 @@ dsOpsTable_get_value(netsnmp_request_info *request,
edc5f2
         the_stat = &context->ops_tbl.dsConnectionsInMaxThreads;
edc5f2
         break;
edc5f2
 
edc5f2
-    case COLUMN_DSMAXTHREADSHIT:
edc5f2
-        the_stat = &context->ops_tbl.dsMaxThreadsHit;
edc5f2
+    case COLUMN_DSMAXTHREADSHITS:
edc5f2
+        the_stat = &context->ops_tbl.dsMaxThreadsHits;
edc5f2
         break;
edc5f2
 
edc5f2
     default: /* We shouldn't get here */
edc5f2
diff --git a/ldap/servers/snmp/ldap-agent.h b/ldap/servers/snmp/ldap-agent.h
edc5f2
index 935d3a611..c98e467dd 100644
edc5f2
--- a/ldap/servers/snmp/ldap-agent.h
edc5f2
+++ b/ldap/servers/snmp/ldap-agent.h
edc5f2
@@ -161,7 +161,7 @@ extern size_t snmptrap_oid_len;
edc5f2
 #define COLUMN_DSERRORS 20
edc5f2
 #define COLUMN_DSCONNECTIONS 21
edc5f2
 #define COLUMN_DSCONNECTIONSINMAXTHREADS 22
edc5f2
-#define COLUMN_DSMAXTHREADSHIT 23
edc5f2
+#define COLUMN_DSMAXTHREADSHITS 23
edc5f2
 #define dsOpsTable_COL_MIN 1
edc5f2
 #define dsOpsTable_COL_MAX 23
edc5f2
 
edc5f2
diff --git a/ldap/servers/snmp/redhat-directory.mib b/ldap/servers/snmp/redhat-directory.mib
edc5f2
index c8608972e..579be8ee4 100644
edc5f2
--- a/ldap/servers/snmp/redhat-directory.mib
edc5f2
+++ b/ldap/servers/snmp/redhat-directory.mib
edc5f2
@@ -87,7 +87,7 @@ RHDS-MIB DEFINITIONS ::= BEGIN
edc5f2
                   dsErrors,
edc5f2
                   dsConnections,
edc5f2
                   dsConnectionsInMaxThreads,
edc5f2
-                  dsMaxThreadsHit,
edc5f2
+                  dsMaxThreadsHits,
edc5f2
                   dsMasterEntries,
edc5f2
                   dsCopyEntries,
edc5f2
                   dsCacheEntries,
edc5f2
@@ -190,7 +190,7 @@ RHDS-MIB DEFINITIONS ::= BEGIN
edc5f2
             Counter64,
edc5f2
         dsConnectionsInMaxThreads
edc5f2
             Counter64,
edc5f2
-        dsMaxThreadsHit
edc5f2
+        dsMaxThreadsHits
edc5f2
             Counter64
edc5f2
 
edc5f2
     }
edc5f2
@@ -472,7 +472,7 @@ RHDS-MIB DEFINITIONS ::= BEGIN
edc5f2
             "Redhat defined 1.2."
edc5f2
         ::= { dsOpsEntry 22 }
edc5f2
 
edc5f2
-    dsMaxThreadsHit OBJECT-TYPE
edc5f2
+    dsMaxThreadsHits OBJECT-TYPE
edc5f2
         SYNTAX Counter64
edc5f2
         MAX-ACCESS read-only
edc5f2
         STATUS current
edc5f2
@@ -596,7 +596,7 @@ RHDS-MIB DEFINITIONS ::= BEGIN
edc5f2
 
edc5f2
     DsIntEntry ::= SEQUENCE {
edc5f2
        dsIntIndex
edc5f2
-	       INTEGER,
edc5f2
+           Integer32,
edc5f2
        dsName
edc5f2
            DistinguishedName,
edc5f2
        dsTimeOfCreation
edc5f2
-- 
edc5f2
2.17.1
edc5f2