<commit_before># coding=utf-8

"""
This collector uses the [ipmitool](http://openipmi.sourceforge.net/) to read
hardware sensors from servers
using the Intelligent Platform Management Interface (IPMI). IPMI is very common
with server hardware but usually not available in consumer hardware.

#### Dependencies

 * [ipmitool](http://openipmi.sourceforge.net/)

"""

import diamond.collector
from subprocess import Popen, PIPE
import os
import getpass


class IPMISensorCollector(diamond.collector.Collector):

    def get_default_config_help(self):
        config_help = super(IPMISensorCollector,
                            self).get_default_config_help()
        config_help.update({
            'bin': 'Path to the ipmitool binary',
            'use_sudo': 'Use sudo?',
            'sudo_cmd': 'Path to sudo',
            'thresholds': 'Collect thresholds as well as reading'
        })
        return config_help

    def get_default_config(self):
        """
        Returns the default collector settings
        """
        config = super(IPMISensorCollector, self).get_default_config()
        config.update({
            'bin':              '/usr/bin/ipmitool',
            'use_sudo':         False,
            'sudo_cmd':         '/usr/bin/sudo',
            'path':             'ipmi.sensors',
            'thresholds':       False,
        })
        return config<commit_msg>Added delimiter option to IPMISensorCollector<commit_after># coding=utf-8

"""
This collector uses the [ipmitool](http://openipmi.sourceforge.net/) to read
hardware sensors from servers
using the Intelligent Platform Management Interface (IPMI). IPMI is very common
with server hardware but usually not available in consumer hardware.

#### Dependencies

 * [ipmitool](http://openipmi.sourceforge.net/)

"""

import diamond.collector
from subprocess import Popen, PIPE
import os
import getpass


class IPMISensorCollector(diamond.collector.Collector):

    def get_default_config_help(self):
        config_help = super(IPMISensorCollector,
                            self).get_default_config_help()
        config_help.update({
            'bin': 'Path to the ipmitool binary',
            'use_sudo': 'Use sudo?',
            'sudo_cmd': 'Path to sudo',
            'thresholds': 'Collect thresholds as well as reading',
            'delimiter':    'Parse blanks in sensor names into a defined delimiter'
        })
        return config_help

    def get_default_config(self):
        """
        Returns the default collector settings
        """
        config = super(IPMISensorCollector, self).get_default_config()
        config.update({
            'bin':              '/usr/bin/ipmitool',
            'use_sudo':         False,
            'sudo_cmd':         '/usr/bin/sudo',
            'path':             'ipmi.sensors',
            'thresholds':       False,
            'delimiter':        '.'
        })
        return config
{'fraction_non_alphanumeric': 0.10023866348448687, 'fraction_numerical': 0.0006818956699624957, 'mean_word_length': 2.2527716186252773, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1444724', 'n_tokens_mistral': 834, 'n_tokens_neox': 785, 'n_words': 214}