Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sg_ses: order of low_crit and low_warn thresholds is mixed for --get command #52

Open
kseniadumpling opened this issue May 31, 2024 · 0 comments

Comments

@kseniadumpling
Copy link

kseniadumpling commented May 31, 2024

Hi! Thanks for writing this SES utility.

Currently we found an issue with --get command for voltage thresholds. It seems the order for low_crit and low_warn is mixed up.

First thing, the raw output for page 5 (Threshold In):

# sg_ses --page=5 /dev/sg24 --raw
00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00  00 00 00 00 87 84 14 14
50 4d 14 14 50 4d 14 14  50 4d 14 14 50 4d 14 14
00 00 00 00 19 14 14 19  19 14 14 19 00 00 00 00
00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00

Here we are interested in VoltageSense01 bytes, that are 19 14 14 19 (aka 25 20 20 25 in decimal).
In SES-3 standard the order of threshold status element is high_crit -> high_warn -> low_warn -> low_crit
image

Hence, I assume that VoltageSense01.low_warn = 14h and VoltageSense01.low_crit = 19h (based on raw data)

However, on a system I got these results:

# sg_ses --descriptor=VoltageSense01 --get=low_warn /dev/sg24
25
# sg_ses --descriptor=VoltageSense01 --get=low_crit /dev/sg24
20

I took a quick look at the code and guess the problem might be hidden here:

/* These are for the Threshold in/out diagnostic page */
static const struct acronym2tuple th_a2t_arr[] = {
    {"high_crit", -1, 0, 7, 8, NULL},
    {"high_warn", -1, 1, 7, 8, NULL},
    {"low_crit", -1, 2, 7, 8, NULL},
    {"low_warn", -1, 3, 7, 8, NULL},
    {NULL, 0, 0, 0, 0, NULL},
};

start_byte (third parameter) for low_crit is higher than low_warn

@kseniadumpling kseniadumpling changed the title Order of low_crit and low_warn thresholds is mixed for --get command sg_ses: order of low_crit and low_warn thresholds is mixed for --get command May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant