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

Parsing of section 3par_node failed #75

Open
mdiogene opened this issue Sep 20, 2024 · 2 comments
Open

Parsing of section 3par_node failed #75

mdiogene opened this issue Sep 20, 2024 · 2 comments

Comments

@mdiogene
Copy link

Hello,

I have tried to use the 3par_ssh package and the check is not collecting data, it endup with this warning:

WARNING: Parsing of section 3par_node failed - please submit a crash report! (Crash-ID: 8792c78a-773a-11ef-be2f-ded04cdc0b7e)
Job details
Starting job...
WARNING: Parsing of section 3par_node failed - please submit a crash report! (Crash-ID: 8792c78a-773a-11ef-be2f-ded04cdc0b7e)
Completed.

my system: HPE Alletra 9000

Do you know what is wrong ?

Best regards,

@Yogibaer75
Copy link
Owner

In this case i need the raw agent output from your device. As the failure happens at parsing time, it means the data can be collected from the device.

@mdiogene
Copy link
Author

In this case i need the raw agent output from your device. As the failure happens at parsing time, it means the data can be collected from the device.

Hello,
Yes, the data are collected but the parsing is not done correctly.

I had this as the output

<<<3par_node>>>
   0 CZ23080CG7-0 OK      No     Yes       Off          GreenBlnk  210624   51200          100
   1 CZ23080CG7-1 OK      Yes    Yes       Off          GreenBlnk  210624   51200          100

I have changed the parsing code by using a simple mapping by attributing each variables extract from ThreeParNode by using node_id as a key to store each entry from ThreeParNode.

def parse_3par_node(string_table: StringTable) -> Section:
    """parse raw data into dict"""
    parsed: dict[str, ThreeParNode] = {}
    for line in string_table:
        # Assurer que la ligne a bien 10 colonnes
        if len(line) == 10 and line[0].isdigit():
            (
                node_id,
                name,
                state,
                master,
                cluster,
                service_led,
                master_led,
                control_mem,
                data_mem,
                cache,
            ) = line
            parsed[node_id] = ThreeParNode(
                node_id=node_id,
                name=name,
                state=state,
                master=master,
                cluster=cluster,
                service_led=service_led,
                master_led=master_led,
                control_mem=control_mem,
                data_mem=data_mem,
                cache=cache,
            )
    return parsed

There is also a problem with 3par_pd.py script. I have not correct it yet.
To gon on for testing the ruleset "[HPE 3par with SSH]" I have disabled 3par_pd in special_agents/agent_threepar_ssh.py but when validating the new monitored services I have an error message du to the fact that your are using number in scripts names.
image

Started at: 14:48:28. Finished at: 14:48:30.
Error running automation call restart (exit code 5), error:
Error precompiling checks for host par01:   File "/omd/sites/cmk/var/check_mk/core/helper_config/112/host_checks/para01", line 40
    import cmk_addons.plugins.threepar_ssh.agent_based.3par_node
                                                       ^
SyntaxError: invalid decimal literal

This error is du to the fact you are using number in script names, you might change it to 3par_node.py -> threepar_node.py
image

If you need the output for 3par_pd, here it is

<<<3par_pd>>>
                           ----Size(MiB)---- -----Ports-----
Id CagePos Type RPM State     Total     Free A       B       Capacity(GB)
 0 0:0:0   SSD  N/A normal  3660800  1294336 0:11:1* 1:11:1*         3840
 1 0:1:0   SSD  N/A normal  3660800  1319936 0:12:1* 1:12:1*         3840
 2 0:2:0   SSD  N/A normal  3660800  1295360 0:13:1* 1:13:1*         3840
 3 0:3:0   SSD  N/A normal  3660800  1318912 0:14:1* 1:14:1*         3840
 4 0:4:0   SSD  N/A normal  3660800  1295360 0:15:1* 1:15:1*         3840
 5 0:5:0   SSD  N/A normal  3660800  1321984 0:16:1* 1:16:1*         3840
 6 0:6:0   SSD  N/A normal  3660800  1293312 0:17:1* 1:17:1*         3840
 7 0:7:0   SSD  N/A normal  3660800  1319936 0:18:1* 1:18:1*         3840
 8 0:8:0   SSD  N/A normal  3660800  1294336 0:19:1* 1:19:1*         3840
 9 0:9:0   SSD  N/A normal  3660800  1320960 0:20:1* 1:20:1*         3840
10 0:10:0  SSD  N/A normal  3660800  1293312 0:21:1* 1:21:1*         3840
11 0:11:0  SSD  N/A normal  3660800  1321984 0:22:1* 1:22:1*         3840
12 2:0:0   SSD  N/A normal  3660800  1294336 0:0:1*  1:0:1*          3840
13 2:1:0   SSD  N/A normal  3660800  1320960 0:0:1*  1:0:1*          3840
14 2:2:0   SSD  N/A normal  3660800  1295360 0:0:1*  1:0:1*          3840
15 2:3:0   SSD  N/A normal  3660800  1321984 0:0:1*  1:0:1*          3840
16 2:4:0   SSD  N/A normal  3660800  1295360 0:0:1*  1:0:1*          3840
17 2:5:0   SSD  N/A normal  3660800  1321984 0:0:1*  1:0:1*          3840
18 2:6:0   SSD  N/A normal  3660800  1293312 0:0:1*  1:0:1*          3840
19 2:7:0   SSD  N/A normal  3660800  1319936 0:0:1*  1:0:1*          3840
20 2:8:0   SSD  N/A normal  3660800  1295360 0:0:1*  1:0:1*          3840
21 2:9:0   SSD  N/A normal  3660800  1321984 0:0:1*  1:0:1*          3840
22 2:10:0  SSD  N/A normal  3660800  1294336 0:0:1*  1:0:1*          3840
23 2:11:0  SSD  N/A normal  3660800  1321984 0:0:1*  1:0:1*          3840
-------------------------------------------------------------------------
24 total                   87859200 31386624

Best regards,

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

2 participants