Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
86
Issues
86
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
White Rabbit Switch - Software
Commits
ebffa319
Commit
ebffa319
authored
Jan 31, 2019
by
Adam Wujek
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
userspace/snmpd: update for LDAP/nslcd
Signed-off-by:
Adam Wujek
<
adam.wujek@cern.ch
>
parent
7e8d4617
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
32 additions
and
2 deletions
+32
-2
wrs-developer-manual.in
doc/wrs-developer-manual.in
+4
-2
fail.tex
doc/wrs_failures/fail.tex
+2
-0
snmp_objects.tex
doc/wrs_failures/snmp_objects.tex
+1
-0
WR-SWITCH-MIB.txt
userspace/snmpd/WR-SWITCH-MIB.txt
+9
-0
wrsBootStatusGroup.c
userspace/snmpd/wrsBootStatusGroup.c
+12
-0
wrsStartCntGroup.c
userspace/snmpd/wrsStartCntGroup.c
+3
-0
wrsStartCntGroup.h
userspace/snmpd/wrsStartCntGroup.h
+1
-0
No files found.
doc/wrs-developer-manual.in
View file @
ebffa319
...
...
@@ -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
...
...
doc/wrs_failures/fail.tex
View file @
ebffa319
...
...
@@ -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}
...
...
doc/wrs_failures/snmp_objects.tex
View file @
ebffa319
...
...
@@ -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
}{}
...
...
userspace/snmpd/WR-SWITCH-MIB.txt
View file @
ebffa319
...
...
@@ -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 }
...
...
userspace/snmpd/wrsBootStatusGroup.c
View file @
ebffa319
...
...
@@ -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 */
...
...
userspace/snmpd/wrsStartCntGroup.c
View file @
ebffa319
...
...
@@ -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
;
...
...
userspace/snmpd/wrsStartCntGroup.h
View file @
ebffa319
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment