Skip to content

A few scripts for monitoring of old HP storage servers with zabbix-agent. A few ansible roles in playbook for deployment scripts.

License

Notifications You must be signed in to change notification settings

Pawsanie/HP_raid-battery_status_monitoring

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HP raid/battery status monitoring.

Monitoring scripts solve the problem of not being able to otherwise get the necessary data on some old HP-iLO servers.

It's specifically about:

  • 🏧A status of the raids of physical disks.
  • 🧮Status of logical disks.
  • 🔋Motherboard battery status.

Disclaimer:

⚠️Using some or all of the elements of this code, You assume responsibility for any consequences!

⚠️The licenses for the technologies on which the code depends are subject to change by their authors.

⚠️Please note that these monitoring scripts are intended for servers Hewlett Packard and uses the "hpssacli" utility.
⚠️This means that you may need a paid subscription or license or their equivalent to use HP software on your machines.


Required:

The monitoring code is written in bash and obviously depends on it.
Bash [GPL-3.0 license]:

Required Applications:

Zabbix [GPL-2.0 license]:

Despite the fact that you can easily change the work of scripts for any kind of monitoring,
the configurations and templates in the repository are designed to work with Zabbix.

HPE Smart Storage Administrator Client (HP-ssacli):

Monitoring is based on parsing output to the terminal from the "hpssacli" application.
Without this application, the work of scripts is not possible.
⚠️Additional charges may apply to use the app.:warning:
Read more on the manufacturer's official website

Ansible [GPL-3.0 license / proprietary (See developer site)]:

For deployment with ansible, if necessary.

Preparing Zabbix agent for monitoring:

  1. Copy the files from the "Scripts" folder to the specified folder on your monitored node.
/etc/zabbix/zabbix_agentd.d/scripts/
  1. Copy the files from the "Zabbix-Agent_configs" folder to the specified folder on your monitored node.
/etc/zabbix/zabbix_agentd.d/
  1. Restart the zabbix agent on the monitored node.
    As an example with bash on CenOs7 servers:
systemctl restart zabbix-agent

Preparing Zabbix server for monitoring:

Apply template "zbx_raid_battery_templates.xml" to Zabbix server.
File location:
./📂HP_raid-battery_status_monitoring
   └── 📁Zabbix-Server_Template
            └── 📄zbx_raid_battery_templates.xml

You can read more about this in the official documentation.

Deployment monitoring with Ansible:

Copy the contents of folders "Scripts" and "Zabbix-Agent_configs" to "files" folder of "copying-monitoring-scripts" ansible role.
"files" folder of role location:
./📂HP_raid-battery_status_monitoring
   └── 📁Ansible-Playbook
            └── 📁roles
                     └── 📁copying-monitoring-scripts
                              └── 📁files

Then fill in the hosts file for the ansible playbook with the actual data.
"hosts" file location:
./📂HP_raid-battery_status_monitoring
   └── 📁Ansible-Playbook
            └── 📁Inventory
                     └── 📄hosts
Example of hosts file in 'Inventory' folder':

[group_hpraid_search]
0.0.0.0
your.dns_name.domen

[group_hpraid_search:vars]
ansible_user=user_name
ansible_ssh_pass=user_password

Run the ansible playbook:

ansible-playbook raid-battary_zabbix.yml

List of Ansible roles in the playbook:

  • copying-monitoring-scripts:
    Copies configurations for zabbix-agent to the folder '/etc/zabbix/zabbix_agentd.d/'.
    Copies monitoring scripts to the folder '/etc/zabbix/zabbix_agentd.d/scripts/'.
  • debian-sudo-install:
    Installs 'sudo' on a debian machine using the 'apt' module.
    Without this modification, zabbix-agent will not collect the necessary information about disks and send it to the server, from machines running debian-based operating systems.
  • sudo-scripts-settings:
    Copies the configuration sudo include in '/etc/sudoers.d/' folder.
    This configuration implies the right to execute only 'hpssacli', and only with the 'ctrl all show config detail' key, on any machine.
    Sudo is required to execute the desired command.
  • zabbix-agent-restart:
    Restarts the zabbix-agent on the node.

Thank you for your interest in my work.

About

A few scripts for monitoring of old HP storage servers with zabbix-agent. A few ansible roles in playbook for deployment scripts.

Topics

Resources

License

Stars

Watchers

Forks

Languages