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