Commit ebffa319 authored by Adam Wujek's avatar Adam Wujek 💬

userspace/snmpd: update for LDAP/nslcd

Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent 7e8d4617
......@@ -1914,8 +1914,10 @@ switch. Check is done every 10 seconds. As for now supervised processes are:
@t{ppsi},
@t{wrs_watchdog},
@t{lighttpd},
@t{dropbear},
@t{snmpd}.
@t{sshd},
@t{snmpd},
@t{lldpd},
@t{nslcd}.
In case any of the supervised processes does not run anymore (because of a crash,
exit etc.), @t{monit} restarts missing process. If 5 restarts of a particular
......
......@@ -709,6 +709,7 @@ list of faults leading to a data error.
\snmpadd{WR-SWITCH-MIB::wrsStartCntWrsWatchdog}\\
\snmpadd{WR-SWITCH-MIB::wrsStartCntLldpd}\\
\snmpadd{WR-SWITCH-MIB::wrsStartCntSPLL}\\
\snmpadd{WR-SWITCH-MIB::wrsStartCntLdap}\\
\snmpadd{WR-SWITCH-MIB::wrsBootUserspaceDaemonsMissing}\\
\snmpadd{WR-SWITCH-MIB::wrsBootSuccessful} \\
\snmpadd{WR-SWITCH-MIB::wrsOSStatus}\\
......@@ -738,6 +739,7 @@ list of faults leading to a data error.
\item \emph{snmpd}
\item \emph{lighttpd}
\item \emph{lldpd}
\item \emph{nslcd} (LDAP)
\item \emph{TRUd/eRSTPd} -- not yet implemented
\end{itemize}
......
......@@ -512,6 +512,7 @@
\snmpentrye{WR-SWITCH-MIB}{wrsStartCntGroup}{wrsStartCntSyslogd}{}
\snmpentrye{WR-SWITCH-MIB}{wrsStartCntGroup}{wrsStartCntWrsWatchdog}{}
\snmpentrye{WR-SWITCH-MIB}{wrsStartCntGroup}{wrsStartCntLldpd}{}
\snmpentrye{WR-SWITCH-MIB}{wrsStartCntGroup}{wrsStartCntLdap}{}
\snmpentrye{WR-SWITCH-MIB}{wrsStartCntGroup}{wrsStartCntSPLL}{Not implemented}
\snmpentrye{WR-SWITCH-MIB}{}{wrsSpllState}{}
......
......@@ -28,6 +28,7 @@ wrSwitchMIB MODULE-IDENTITY
REVISION "201807181400Z"
DESCRIPTION
"Add wrsStartCntLldpd
Add wrsStartCntLdap
Add in wrsPortStatusTable:
- wrsPortStatusMonitor
- wrsPortStatusSfpDom
......@@ -1167,6 +1168,14 @@ wrsStartCntLldpd OBJECT-TYPE
"Number of LLDP daemon starts"
::= { wrsStartCntGroup 9 }
wrsStartCntLdap OBJECT-TYPE
SYNTAX Counter32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Number of LDAP daemon starts"
::= { wrsStartCntGroup 9 }
-- wrsSpllState (.7.3)
wrsSpllState OBJECT IDENTIFIER ::= { wrsExpertStatus 3 }
......
......@@ -96,6 +96,7 @@ struct wrs_usd_item {
#define UDI_HTTP 4 /* index of web server in userspace_daemons array */
#define UDI_MONIT 5 /* index of MONIT in userspace_daemons array */
#define UDI_LLDP 8 /* index of LLDP in userspace_daemons array */
#define UDI_NSLCD 9 /* index of NSLCD (LDAP) in userspace_daemons array */
/* user space daemon list */
/* - key contain process name reported by ps command
* - positive exp describe exact number of expected processes
......@@ -117,6 +118,8 @@ static struct wrs_usd_item userspace_daemons[] = {
[7] = {"/wr/bin/wrs_watchdog", 1},
[UDI_LLDP] = {"/usr/sbin/lldpd", 1}, /* LLDP can be disabled in
dot-config */
[UDI_NSLCD] = {"/usr/sbin/nslcd", 1}, /* nslcd/LDAP can be disabled in
dot-config */
};
struct wrs_bc_item {
......@@ -496,6 +499,15 @@ static void update_daemon_expectancy(struct wrs_usd_item *daemon_array)
snmp_log(LOG_INFO, "SNMP: Info wrsBootUserspaceDaemonsMissing:"
" CONFIG_LLDPD_DISABLE=y in dot-config\n");
}
daemon_array[UDI_NSLCD].exp = 0;
tmp = libwr_cfg_get("LDAP_ENABLE");
if (tmp && !strcmp(tmp, "y")) {
/* SNMP should not expect nslcd/LDAP to be running */
daemon_array[UDI_NSLCD].exp = 1;
snmp_log(LOG_INFO, "SNMP: Info wrsBootUserspaceDaemonsMissing:"
"no CONFIG_LDAP_ENABLE in dot-config\n");
}
}
/* check if daemons from userspace_daemons array are running */
......
......@@ -8,6 +8,7 @@
#define START_CNT_SYSLOGD "/tmp/start_cnt_syslogd"
#define START_CNT_WRSWATCHDOG "/tmp/start_cnt_wrs_watchdog"
#define START_CNT_LLDPD "/tmp/start_cnt_lldpd"
#define START_CNT_LDAP "/tmp/start_cnt_ldap"
static struct pickinfo wrsStartCnt_pickinfo[] = {
FIELD(wrsStartCnt_s, ASN_COUNTER, wrsStartCntHAL),
......@@ -19,6 +20,7 @@ static struct pickinfo wrsStartCnt_pickinfo[] = {
FIELD(wrsStartCnt_s, ASN_COUNTER, wrsStartCntSyslogd),
FIELD(wrsStartCnt_s, ASN_COUNTER, wrsStartCntWrsWatchdog),
FIELD(wrsStartCnt_s, ASN_COUNTER, wrsStartCntLldpd),
FIELD(wrsStartCnt_s, ASN_COUNTER, wrsStartCntLdap),
};
struct wrsStartCnt_s wrsStartCnt_s;
......@@ -77,6 +79,7 @@ time_t wrsStartCnt_data_fill(void){
read_start_count(START_CNT_SYSLOGD, &wrsStartCnt_s.wrsStartCntSyslogd);
read_start_count(START_CNT_WRSWATCHDOG, &wrsStartCnt_s.wrsStartCntWrsWatchdog);
read_start_count(START_CNT_LLDPD, &wrsStartCnt_s.wrsStartCntLldpd);
read_start_count(START_CNT_LDAP, &wrsStartCnt_s.wrsStartCntLdap);
/* there was an update, return current time */
return time_update;
......
......@@ -14,6 +14,7 @@ struct wrsStartCnt_s {
uint32_t wrsStartCntSyslogd;
uint32_t wrsStartCntWrsWatchdog;
uint32_t wrsStartCntLldpd;
uint32_t wrsStartCntLdap;
};
extern struct wrsStartCnt_s wrsStartCnt_s;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment