<commit_before>Ohai.plugin(:Fail2ban) do
  provides 'fail2ban'

  def logfile_path
    so = shell_out('fail2ban-client get logtarget')
    logline = so.stdout.split("\n")[1]
    loglocation = logline.split(' ')[1]
    Ohai::Log.debug("fail2ban log location: #{loglocation}")

    if loglocation == 'SYSLOG'
      loglocation = '/var/log/syslog'
      loglocation = '/var/log/messages' if File.exist?('/var/log/messages')
    end

    loglocation
  end

  def jails_list
    so = shell_out('fail2ban-client status')
    lines = so.stdout.split("\n")
    Ohai::Log.debug("fail2ban status: #{lines}")
    comma_jails = lines[2].split("\t\t")[1]
    list_of_jails = [*comma_jails.split(', ')]
    Ohai::Log.debug("fail2ban jails: #{list_of_jails}")
    list_of_jails
  end

  def activity_log<commit_msg>Changes fail2ban plugin to work with CentOS7wq<commit_after>Ohai.plugin(:Fail2ban) do
  provides 'fail2ban'

  def logfile_path
    so = shell_out('fail2ban-client get logtarget')
    logline = so.stdout.split("\n")[1]
    loglocation = logline.split(' ')[1]
    Ohai::Log.debug("fail2ban log location: #{loglocation}")

    if loglocation == 'SYSLOG'
      loglocation = '/var/log/syslog'
      loglocation = '/var/log/messages' if File.exist?('/var/log/messages')
    end

    loglocation
  end

  def jails_list
    so = shell_out('fail2ban-client status')
    lines = so.stdout.split("\n")
    Ohai::Log.debug("fail2ban status: #{lines}")
    comma_jails = lines[2].split("\t")[-1]
    list_of_jails = [*comma_jails.split(', ')]
    Ohai::Log.debug("fail2ban jails: #{list_of_jails}")
    list_of_jails
  end

  def activity_log
{'fraction_non_alphanumeric': 0.1556372549019608, 'fraction_numerical': 0.014705882352941176, 'mean_word_length': 3.6, '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': '3905876', 'n_tokens_mistral': 600, 'n_tokens_neox': 596, 'n_words': 109}