description='A fast(er) prometheus exporter for applicable HP servers using SNMP via the ILO controller.',
)
arg_parser.add_argument('-i','--ilo-address',help='ILO IP address to scan.',required=True)
arg_parser.add_argument('-a','--server-address',default='0.0.0.0',help='Address to bind for hosting the metrics endpoint.')
arg_parser.add_argument('-p','--server-port',default=6969,help='Port to bind for the metrics endpoint.')
arg_parser.add_argument('-c','--snmp-community',default='public',help='SNMP community to read.')
arg_parser.add_argument('--snmp-port',default=161,help='SNMP port to use.')
arg_parser.add_argument('-o','--scan-once',action='store_true',help='Only scan for SNMP variables on init, instead of on each collection (except hard drives, see --scan-drives-once). This is a small optimizaion that can be used if your sever configuration never changes.')
arg_parser.add_argument('--scan-drives-once',action='store_true',help='When combined with --scan-once, this also prevents hard drives from being rescanned on collection. This is not recommeded.')
arg_parser.add_argument('-q','--quiet',action='store_true',help='Tells the exporter to stfu under normal operation unless there is an error/warning.')
args=arg_parser.parse_args()
ifargs.quietandargs.verbose:
print('stop it. (--quiet and --verbose do not mix)')
exit(1)
SCAN_FAIL_COUNTER=Counter('exporter','Number of times scanning the iLO for SNMP variables has failed.',namespace=NAMESPACE,subsystem='snmp_scan_failures')
('Information about installed drives',no_value,[DRIVE_PORT,DRIVE_BOX,DRIVE_BAY,DRIVE_VENDOR,DRIVE_MODEL,DRIVE_SERIAL,DRIVE_LINK_RATE,DRIVE_STATUS,DRIVE_CONDITION]),
('Sizes of installed drives in megabytes',DRIVE_SIZE,[DRIVE_PORT,DRIVE_BOX,DRIVE_BAY,DRIVE_VENDOR,DRIVE_MODEL,DRIVE_SERIAL]),
('Temperatures of installed drives in celsius',DRIVE_TEMP,[DRIVE_PORT,DRIVE_BOX,DRIVE_BAY,DRIVE_VENDOR,DRIVE_MODEL,DRIVE_SERIAL]),
('Temperature thresholds of installed drives in celsius',DRIVE_TEMP_THRESHOLD,[DRIVE_PORT,DRIVE_BOX,DRIVE_BAY,DRIVE_VENDOR,DRIVE_MODEL,DRIVE_SERIAL]),
('Maximum temperatures of installed drives in celsius',DRIVE_TEMP_MAX,[DRIVE_PORT,DRIVE_BOX,DRIVE_BAY,DRIVE_VENDOR,DRIVE_MODEL,DRIVE_SERIAL]),
('Reference time of installed drives in hours',DRIVE_REFERENCE_TIME,[DRIVE_PORT,DRIVE_BOX,DRIVE_BAY,DRIVE_VENDOR,DRIVE_MODEL,DRIVE_SERIAL]),