node-exporter-textfile-collector-scripts icon indicating copy to clipboard operation
node-exporter-textfile-collector-scripts copied to clipboard

storcli.py generate no metrics

Open DavideM78 opened this issue 4 years ago • 6 comments

Hi to everybody, I was trying to generate metrics with the script, only they are not generated. Trying to direct the output of the script to a normal text file makes it empty. Other scripts I installed work perfectly. Does anyone have any idea what it might be? Using python3 and storecli 1.21.06 Thanks to anybody wo will take a look.

Davide

DavideM78 avatar Dec 07 '20 15:12 DavideM78

You'll probably get more eyes on your problem by posting this to the prometheus-users mailing list / google group. Github issues are not really the best place for general tech support.

Your storcli version number sounds extremely old, is it should be something like 7.x.x.x. The storcli.py collector requires a version of storcli that can support JSON output.

dswarbrick avatar Dec 31 '20 19:12 dswarbrick

@DavideM78 Do you use script with sudo user ?

SckyzO avatar Jan 13 '21 12:01 SckyzO

@DavideM78 Was trying script now, ill will recomend change pass on error in def main() and print actual error.

For me it printed only metric megaraid_controller_info and then it ended up on error, because of line 79

    if 'ROC temperature(Degree Celc' + 'ius)' in response['HwCfg'].keys():
        response['HwCfg']['ROC temperature(Degree Celsius)'] = response['HwCfg'].pop(
            'ROC temperature(Degree Celc' + 'ius)'
        )
    add_metric('temperature', baselabel, int(response['HwCfg']['ROC temperature(Degree Celsius)']))

the add_metric need to be inside of the if

frenkye avatar Mar 18 '21 15:03 frenkye

I also don't get metrics. Using "StorCli SAS Customization Utility Ver 007.1616.0000.0000" as /opt/hpe/storcli/storcli64, and edited "storcli.py" accordingly.

No errors, only output is:

# /usr/local/bin/storcli.py
# HELP megaraid_controller_info MegaRAID controller info
# TYPE megaraid_controller_info gauge
megaraid_controller_info{controller="0",model="RAID Ctrl SAS 6G 0/1 (D2607)",serial="FW-2B5DCAT1AABWA",fwversion="2.130.354-2728"} 1.0

Trying to debug, /opt/hpe/storcli/storcli64 /cALL show all J returns a long list with "Controllers:" inside. Will try to dig deeper.

stefangweichinger avatar May 19 '23 13:05 stefangweichinger

Tried https://github.com/prometheus-community/node-exporter-textfile-collector-scripts/pull/94 without success.

stefangweichinger avatar May 19 '23 13:05 stefangweichinger

#95 helps

stefangweichinger avatar May 19 '23 15:05 stefangweichinger