Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
White Rabbit Switch - Software
Manage
Activity
Members
Labels
Plan
Issues
85
Issue boards
Milestones
Wiki
Code
Merge requests
4
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Projects
White Rabbit Switch - Software
Commits
e25ca7a4
Commit
e25ca7a4
authored
8 years ago
by
Grzegorz Daniluk
Committed by
Adam Wujek
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
userspace/snmpd: add verbosity to the wrsBootStatusGroup
Signed-off-by:
Adam Wujek
<
adam.wujek@cern.ch
>
parent
2dce12fe
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
userspace/snmpd/wrsBootStatusGroup.c
+24
-10
24 additions, 10 deletions
userspace/snmpd/wrsBootStatusGroup.c
with
24 additions
and
10 deletions
userspace/snmpd/wrsBootStatusGroup.c
+
24
−
10
View file @
e25ca7a4
...
...
@@ -123,8 +123,8 @@ static void get_boot_info(void){
/* get restart reason */
rcsr_map
=
create_map
(
ARM_RCSR_ADDR
,
sizeof
(
uint32_t
));
if
(
!
rcsr_map
)
{
snmp_log
(
LOG_ERR
,
"SNMP:
wrsBootStatusGroup
unable to
map
"
"CPU's Reset Controller Status Register
\n
"
);
snmp_log
(
LOG_ERR
,
"SNMP:
"
SL_ER
" wrsRestartReason:
unable to"
"
map
CPU's Reset Controller Status Register
\n
"
);
/* pass error to SNMP, assign 1 */
wrsBootStatus_s
.
wrsRestartReason
=
WRS_RESTART_REASON_ERROR
;
/* try again next time */
...
...
@@ -138,8 +138,8 @@ static void get_boot_info(void){
f
=
fopen
(
BOOTCOUNT_FILE
,
"r"
);
if
(
!
f
)
{
snmp_log
(
LOG_ERR
,
"SNMP:
wrsBootStatusGroup
failed to
open
"
BOOTCOUNT_FILE
"
\n
"
);
snmp_log
(
LOG_ERR
,
"SNMP:
"
SL_ER
" wrsRestartReason:
failed to"
" open "
BOOTCOUNT_FILE
"
\n
"
);
/* notify snmp about error in restart reason */
wrsBootStatus_s
.
wrsRestartReason
=
WRS_RESTART_REASON_ERROR
;
/* try again next time */
...
...
@@ -215,6 +215,8 @@ static void get_dotconfig_source(void)
* a problem */
wrsBootStatus_s
.
wrsConfigSource
=
WRS_CONFIG_SOURCE_ERROR_MINOR
;
snmp_log
(
LOG_ERR
,
"SNMP: "
SL_ER
" wrsConfigSource: failed to "
"open "
DOTCONFIGDIR
"/"
DOTCONFIG_SOURCE
"
\n
"
);
}
/* read dot-config's URL only when config source is not local */
...
...
@@ -230,6 +232,9 @@ static void get_dotconfig_source(void)
/* host file not found, put "error" into
* wrsConfigSourceHost */
strcpy
(
wrsBootStatus_s
.
wrsConfigSourceUrl
,
"error"
);
snmp_log
(
LOG_ERR
,
"SNMP: "
SL_ER
" wrsConfigSourceUrl:"
" failed to open "
DOTCONFIGDIR
"/"
DOTCONFIG_SOURCE_URL
"
\n
"
);
}
}
else
{
memset
(
wrsBootStatus_s
.
wrsConfigSourceUrl
,
0
,
...
...
@@ -261,6 +266,8 @@ static void get_dotconfig_source(void)
* a problem */
wrsBootStatus_s
.
wrsConfigSource
=
WRS_CONFIG_STATUS_ERROR_MINOR
;
snmp_log
(
LOG_ERR
,
"SNMP: "
SL_ER
" wrsConfigSource: failed to "
"open "
DOTCONFIGDIR
"/"
DOTCONFIG_STATUS
"
\n
"
);
}
}
...
...
@@ -305,6 +312,8 @@ static void get_boot_scripts_status(void){
* a problem */
wrsBootStatus_s
.
wrsBootHwinfoReadout
=
WRS_BOOT_HWINFO_ERROR_MINOR
;
snmp_log
(
LOG_ERR
,
"SNMP: "
SL_ER
" wrsBootHwinfoReadout: "
"failed to open "
HWINFO_FILE
"
\n
"
);
/* try again next time */
run_once
=
0
;
}
...
...
@@ -336,6 +345,8 @@ static void get_boot_scripts_status(void){
* a problem */
wrsBootStatus_s
.
wrsBootLoadFPGA
=
WRS_BOOT_LOAD_FPGA_ERROR_MINOR
;
snmp_log
(
LOG_ERR
,
"SNMP: "
SL_ER
" wrsBootLoadFPGA: failed to "
"open "
LOAD_FPGA_STATUS_FILE
"
\n
"
);
/* try again next time */
run_once
=
0
;
}
...
...
@@ -367,6 +378,8 @@ static void get_boot_scripts_status(void){
* a problem */
wrsBootStatus_s
.
wrsBootLoadLM32
=
WRS_BOOT_LOAD_LM32_ERROR_MINOR
;
snmp_log
(
LOG_ERR
,
"SNMP: "
SL_ER
" wrsBootLoadLM32: failed to "
"open "
LOAD_FPGA_STATUS_FILE
"
\n
"
);
/* try again next time */
run_once
=
0
;
}
...
...
@@ -385,8 +398,8 @@ static void get_loaded_kernel_modules_status(void)
f
=
fopen
(
MODULES_FILE
,
"r"
);
if
(
!
f
)
{
snmp_log
(
LOG_ERR
,
"SNMP:
wrsBootStatusGroup failed to open
"
MODULES_FILE
"
\n
"
);
snmp_log
(
LOG_ERR
,
"SNMP:
"
SL_ER
" wrsBootKernelModulesMissing
"
": failed to open "
MODULES_FILE
"
\n
"
);
/* notify snmp about error in kernel modules */
wrsBootStatus_s
.
wrsBootKernelModulesMissing
=
ARRAY_SIZE
(
kernel_modules
);
...
...
@@ -441,8 +454,9 @@ static void get_daemons_status(void)
* but probably slower than manually parsing /proc/ */
f
=
popen
(
PROCESS_COMMAND
,
"r"
);
if
(
!
f
)
{
snmp_log
(
LOG_ERR
,
"SNMP: wrsBootStatusGroup failed to execute "
PROCESS_COMMAND
"
\n
"
);
snmp_log
(
LOG_ERR
,
"SNMP: "
SL_ER
" wrsBootUserspaceDaemonsMissing: failed to execute "
PROCESS_COMMAND
"
\n
"
);
wrsBootStatus_s
.
wrsBootUserspaceDaemonsMissing
=
0
;
/* Notify snmp about error in processes list */
/* Count number of expected processes */
...
...
@@ -505,8 +519,8 @@ static void get_n_watchdog_timouts(void)
f
=
popen
(
WDOG_COMMAND
,
"r"
);
if
(
!
f
)
{
snmp_log
(
LOG_ERR
,
"SNMP:
wrsBootStatusGroup failed to execute
"
WDOG_COMMAND
"
\n
"
);
snmp_log
(
LOG_ERR
,
"SNMP:
"
SL_ER
" wrsGwWatchdogTimeouts:
"
"failed to execute "
WDOG_COMMAND
"
\n
"
);
return
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment