Linux server.edchosting.com 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64
LiteSpeed
Server IP : 75.98.162.185 & Your IP : 216.73.216.163
Domains :
Cant Read [ /etc/named.conf ]
User : goons4good
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
lib64 /
nagios /
plugins /
Delete
Unzip
Name
Size
Permission
Date
Action
eventhandlers
[ DIR ]
drwxr-xr-x
2024-03-10 06:52
a2_csf_modsecsync.mvps.mdedi
1.27
KB
-rwxr-xr-x
2025-09-10 09:31
a2_customerview.sh.shared
1.21
KB
-rwxr-xr-x
2025-09-10 09:31
a2_nf_conntrack_count.sh.all
977
B
-rwxr-xr-x
2025-09-10 09:31
a2_postgresql-monitor.shared
1.23
KB
-rwxr-xr-x
2025-09-10 09:31
a2_ram.shared.mdedi.bmi
611
B
-rwxr-xr-x
2025-09-10 09:31
a2_sssd_service_check.sh.all
1.4
KB
-rwxr-xr-x
2025-09-10 09:31
a2_system-updates.all
2.18
KB
-rwxr-xr-x
2025-09-10 09:31
a2_temperature_check.shared.bmi
3.17
KB
-rwxr-xr-x
2025-09-10 09:31
a2_user_mem.shared
1.13
KB
-rwxr-xr-x
2025-09-10 09:31
a2_yum_processes.shared
835
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_backup_network
844
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_backups
2.64
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_cagefs.shared.mvps.mdedi
762
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_cagefs_503_errors
2.96
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_cpdavd_cpu.sh
701
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_cpu_throttle.shared
1.61
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_dbgov.shared
1.23
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_dedi_nvme.mdedi
894
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_devnull-perms.shared
161
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_dimm.shared
1.49
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_disk.sh
2.05
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_dmi.sh.all
2.38
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_dnsdist_cache.sh
298
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_dnsdist_health.sh
270
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_dnsdist_pools.sh
414
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_dnsdist_proc.sh
210
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_dovecot
191
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_extra_ips.shared
854
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_fsstate.sh.all
2.28
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_fw.sh.internal
2.11
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_fw.sh.shared
1.04
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_grub.sh.all
1.22
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_httpdconf.shared
1.16
KB
-rwxr-xr-x
2025-04-15 08:48
check_a2_ifspeed.shared
784
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_imap_auth
1.2
KB
-rwxr-xr-x
2025-02-19 06:03
check_a2_imunify_service
910
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_ipaliases.shared
443
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_ipastatus.sh
2.16
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_ipmi_ip.sh.shared
565
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_jbk_client_limits.sh
1.13
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_jetbackup.sh
12.08
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_largelogs.shared
966
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_le_certs.sh.saltmaster1
1.02
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_load.php
618
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_long_mysql_queries
1.22
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_mailqueue.mvps.mdedi
1.26
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_memlimits-on.shared
458
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_mod-passenger.shared
516
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_monitor-randomize_sqlroot_password_cron.shared.mvps.mdedi
322
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_mysql-monitor.shared.mvps.mdedi
2.62
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_mysql-replication.sh
1.33
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_mysql_tmp_size
242
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_olderdrive_health.all
2.25
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_omni_mysql_backup.sh
1.15
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_omni_pxe_https_check.sh
1.27
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_omni_saltmaster1_authcheck.sh
2.76
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_omni_website.sh
1.01
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_outbound_nat.sh
436
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_packets.mvps
1.73
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_pdns
462
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_php_versions.shared
3.04
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_redis_opcache.shared
1.39
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_salt_minion_service
196
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_salt_running.all
1.83
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_saltmaster_api.sh
1.13
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_smart.py.all
15.54
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_softy_version.sh.shared.mvps.mdedi
1.09
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_vps_memory.sh
411
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_vz7-ikvm_backup.sh
1.2
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_whm_ssl
874
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_whmcs_db_mysql-replication.sh
2.19
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_whmcs_nginx_connections.sh
745
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_whmcs_phpfpm_status.sh
1.6
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_whmcs_th_network.sh
773
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_whmcs_virtualizor.sh
534
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_xen_guest_vm.sh.flexdedi
3.11
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_zpool.sh
1.31
KB
-rwxr-xr-x
2025-09-10 09:31
check_aad_ldaps
2.09
KB
-rwxr-xr-x
2025-11-03 05:31
check_apache_status.pl
6.09
KB
-rwxr-xr-x
2025-09-10 09:31
check_backup_zpool
17.68
KB
-rwxr-xr-x
2025-09-10 09:31
check_backuply.py
5.77
KB
-rwxr-xr-x
2025-09-10 09:31
check_backups.php
576
B
-rwxr-xr-x
2025-09-10 09:31
check_breeze
2.29
KB
-rwxr-xr-x
2024-04-11 07:27
check_by_ssh
61.16
KB
-rwxr-xr-x
2024-04-11 07:27
check_clamd
61.13
KB
-rwxr-xr-x
2024-04-11 07:27
check_cluster
40.35
KB
-rwxr-xr-x
2024-04-11 07:27
check_cpu
467
B
-rwxr-xr-x
2025-09-10 09:31
check_cpu_interrupts
353
B
-rwxr-xr-x
2025-09-10 09:31
check_cpu_steal
313
B
-rwxr-xr-x
2025-09-10 09:31
check_crond
227
B
-rwxr-xr-x
2025-09-10 09:31
check_csf
535
B
-rwxr-xr-x
2025-09-10 09:31
check_dhcp
56.75
KB
-rwsr-x---
2024-04-11 07:27
check_dig
56.83
KB
-rwxr-xr-x
2024-04-11 07:27
check_disk
86.26
KB
-rwxr-xr-x
2024-04-11 07:27
check_disk_smb
9.9
KB
-rwxr-xr-x
2024-04-11 07:27
check_dns
249
B
-rwxr-xr-x
2025-09-10 09:31
check_dummy
31.76
KB
-rwxr-xr-x
2024-04-11 07:27
check_elastic
10.49
KB
-rwxr-xr-x
2025-09-10 09:31
check_elasticsearch
335
B
-rwxr-xr-x
2025-09-10 09:31
check_enhance_backup
495
B
-rwxr-xr-x
2025-09-10 09:31
check_exim
184
B
-rwxr-xr-x
2025-09-10 09:31
check_exim_spam.sh
3.44
KB
-rwxr-xr-x
2025-09-10 09:31
check_eximqueue.sh
1.11
KB
-rwxr-xr-x
2025-09-10 09:31
check_file_age
4.95
KB
-rwxr-xr-x
2024-04-11 07:27
check_flexlm
6.35
KB
-rwxr-xr-x
2024-04-11 07:27
check_fping
56.76
KB
-rwsr-x---
2024-04-11 07:27
check_ftp
61.13
KB
-rwxr-xr-x
2024-04-11 07:27
check_ftpd
199
B
-rwxr-xr-x
2025-09-10 09:31
check_game
44.5
KB
-rwxr-xr-x
2024-04-11 07:27
check_hpjd
52.5
KB
-rwxr-xr-x
2024-04-11 07:27
check_http
106.2
KB
-rwxr-xr-x
2024-04-11 07:27
check_icmp
68.39
KB
-rwsr-x---
2024-04-11 07:27
check_ide_smart
44.57
KB
-rwsr-x---
2024-04-11 07:27
check_imap
61.13
KB
-rwxr-xr-x
2024-04-11 07:27
check_iowait
587
B
-rwxr-xr-x
2025-09-10 09:31
check_ipaliases.py
2.14
KB
-rwxr-xr-x
2025-09-10 09:31
check_ipmi_sensor
39.45
KB
-rwxr-xr-x
2025-09-10 09:31
check_ircd
6.82
KB
-rwxr-xr-x
2024-04-11 07:27
check_jabber
61.13
KB
-rwxr-xr-x
2024-04-11 07:27
check_jetbackup.py
12.8
KB
-rwxr-xr-x
2025-09-10 09:31
check_jetbackup_alerts
5.35
KB
-rwxr-xr-x
2025-09-10 09:31
check_jetbackup_license.sh
581
B
-rwxr-xr-x
2025-09-10 09:31
check_jetbackup_mongodb
915
B
-rwxr-xr-x
2025-09-10 09:31
check_jetbackup_queue
4.83
KB
-rwxr-xr-x
2025-09-10 09:31
check_kernel
393
B
-rwxr-xr-x
2025-09-10 09:31
check_ldap
61.07
KB
-rwxr-xr-x
2024-04-11 07:27
check_ldaps
61.07
KB
-rwxr-xr-x
2024-04-11 07:27
check_litespeed
2.43
KB
-rwxr-xr-x
2025-09-10 09:31
check_load
48.39
KB
-rwxr-xr-x
2024-04-11 07:27
check_load.php
422
B
-rwxr-xr-x
2025-09-10 09:31
check_load.py
401
B
-rwxr-xr-x
2025-09-10 09:31
check_local_users
2.01
MB
-rwxr-xr-x
2025-09-10 09:31
check_log
7.99
KB
-rwxr-xr-x
2024-04-11 07:27
check_lvm_thinpools
2.48
KB
-rwxr-xr-x
2025-09-10 09:31
check_mailq
25
KB
-rwxr-xr-x
2024-04-11 07:27
check_managed.sh
5.85
KB
-rwxr-xr-x
2025-09-10 09:31
check_md5files
1.2
KB
-rwxr-xr-x
2025-09-10 09:31
check_md_raid
782
B
-rwxr-xr-x
2025-09-10 09:31
check_megaraid_sas
6.75
KB
-rwxr-xr-x
2025-09-10 09:31
check_memcached
184
B
-rwxr-xr-x
2025-09-10 09:31
check_meminfo
2.79
KB
-rwxr-xr-x
2025-09-10 09:31
check_memory
330
B
-rwxr-xr-x
2025-09-10 09:31
check_memory.py
1.06
KB
-rwxr-xr-x
2025-09-10 09:31
check_mrtg
44.42
KB
-rwxr-xr-x
2024-04-11 07:27
check_mrtgtraf
44.36
KB
-rwxr-xr-x
2024-04-11 07:27
check_mysql
52.91
KB
-rwxr-xr-x
2024-04-11 07:27
check_mysql_all.sh
6.53
KB
-rwxr-xr-x
2025-09-10 09:31
check_mysql_connections
5.89
KB
-rwxr-xr-x
2025-09-10 09:31
check_mysql_engines
603
B
-rwxr-xr-x
2025-09-10 09:31
check_mysql_log
170
B
-rwxr-xr-x
2025-09-10 09:31
check_mysql_memory
733
B
-rwxr-xr-x
2025-09-10 09:31
check_mysql_processes
346
B
-rwxr-xr-x
2025-09-10 09:31
check_mysql_query
48.71
KB
-rwxr-xr-x
2024-04-11 07:27
check_nagios
44.34
KB
-rwxr-xr-x
2024-04-11 07:27
check_nimbus.sh
2.25
KB
-rwxr-xr-x
2025-09-10 09:31
check_nntp
61.13
KB
-rwxr-xr-x
2024-04-11 07:27
check_nntps
61.13
KB
-rwxr-xr-x
2024-04-11 07:27
check_nscp_api
5.84
MB
-rwxr-xr-x
2024-10-29 07:19
check_nt
56.65
KB
-rwxr-xr-x
2024-04-11 07:27
check_ntp
56.84
KB
-rwxr-xr-x
2024-04-11 07:27
check_ntp.pl
14.53
KB
-rwxr-xr-x
2024-04-11 07:27
check_ntp_peer
56.91
KB
-rwxr-xr-x
2024-04-11 07:27
check_ntp_time
52.84
KB
-rwxr-xr-x
2024-04-11 07:27
check_nwstat
68.52
KB
-rwxr-xr-x
2024-04-11 07:27
check_oracle
9.27
KB
-rwxr-xr-x
2024-04-11 07:27
check_overcr
48.49
KB
-rwxr-xr-x
2024-04-11 07:27
check_partitions
434
B
-rwxr-xr-x
2025-09-10 09:31
check_pgsql
56.95
KB
-rwxr-xr-x
2024-04-11 07:27
check_ping
60.77
KB
-rwxr-xr-x
2024-04-11 07:27
check_pop
61.13
KB
-rwxr-xr-x
2024-04-11 07:27
check_postfix
193
B
-rwxr-xr-x
2025-09-10 09:31
check_postfix_queue
930
B
-rwxr-xr-x
2025-09-10 09:31
check_postgres
445.78
KB
-rwxr-xr-x
2025-09-10 09:31
check_procs
60.99
KB
-rwxr-xr-x
2024-04-11 07:27
check_proxmox.sh
928
B
-rwxr-xr-x
2025-09-10 09:31
check_proxmox_backups.sh
1.86
KB
-rwxr-xr-x
2025-09-10 09:31
check_qps_dnsdist.sh
1.68
KB
-rwxr-xr-x
2025-09-10 09:31
check_real
48.59
KB
-rwxr-xr-x
2024-04-11 07:27
check_redis.sh
175
B
-rwxr-xr-x
2025-09-10 09:31
check_resolver.py
3.27
KB
-rwxr-xr-x
2025-09-10 09:31
check_rpc
9.45
KB
-rwxr-xr-x
2024-04-11 07:27
check_rpmdb
690
B
-rwxr-xr-x
2025-09-10 09:31
check_sensors
1.59
KB
-rwxr-xr-x
2024-04-11 07:27
check_service.sh
9.94
KB
-rwxr-xr-x
2025-09-10 09:31
check_simap
61.13
KB
-rwxr-xr-x
2024-04-11 07:27
check_smart.pl
35.16
KB
-rwxr-xr-x
2025-09-10 09:31
check_smartarray.py
10.07
KB
-rwxr-xr-x
2025-09-10 09:31
check_smartermail_queue
1.5
KB
-rwxr-xr-x
2025-09-10 09:31
check_smtp
69.23
KB
-rwxr-xr-x
2024-04-11 07:27
check_snmp
77.59
KB
-rwxr-xr-x
2024-04-11 07:27
check_spop
61.13
KB
-rwxr-xr-x
2024-04-11 07:27
check_ssh
48.59
KB
-rwxr-xr-x
2024-04-11 07:27
check_ssmtp
61.13
KB
-rwxr-xr-x
2024-04-11 07:27
check_sssd
1.32
KB
-rwxr-xr-x
2025-09-10 09:31
check_supervisord.py
15.71
KB
-rwxr-xr-x
2025-09-10 09:31
check_swap
44.33
KB
-rwxr-xr-x
2024-04-11 07:27
check_tcp
61.13
KB
-rwxr-xr-x
2024-04-11 07:27
check_time
48.55
KB
-rwxr-xr-x
2024-04-11 07:27
check_tmp
210
B
-rwxr-xr-x
2025-09-10 09:31
check_udp
61.13
KB
-rwxr-xr-x
2024-04-11 07:27
check_ups
52.61
KB
-rwxr-xr-x
2024-04-11 07:27
check_users
40.2
KB
-rwxr-xr-x
2024-04-11 07:27
check_vm_status.sh
635
B
-rwxr-xr-x
2025-09-10 09:31
check_wave
3.19
KB
-rwxr-xr-x
2024-04-11 07:27
check_webserver_status
2.93
KB
-rwxr-xr-x
2025-09-10 09:31
check_yum_updates
600
B
-rwxr-xr-x
2025-09-10 09:31
check_zfs
17.68
KB
-rwxr-xr-x
2025-09-10 09:31
check_zpool_usage.sh
885
B
-rwxr-xr-x
2025-09-10 09:31
md5list
61
B
-rw-r--r--
2025-09-10 09:31
negate
40.18
KB
-rwxr-xr-x
2024-04-11 07:27
urlize
35.97
KB
-rwxr-xr-x
2024-04-11 07:27
utils.pm
2.05
KB
-rw-r--r--
2024-04-11 07:27
utils.sh
2.73
KB
-rwxr-xr-x
2024-04-11 07:27
vz7_check_a2_backup_timer_enabled.sh
605
B
-rwxr-xr-x
2025-09-10 09:31
vz7_check_a2_backups-check.sh
8.4
KB
-rwxr-xr-x
2025-09-10 09:31
vz7_check_a2_backups-running.sh
2.18
KB
-rwxr-xr-x
2025-09-10 09:31
vz7_check_a2_fw.sh
1.37
KB
-rwxr-xr-x
2025-09-10 09:31
vz7_check_a2_ifspeed.sh
1.04
KB
-rwxr-xr-x
2025-09-10 09:31
vz7_check_a2_license.sh
749
B
-rwxr-xr-x
2025-09-10 09:31
vz7_check_a2_template_count.sh
856
B
-rwxr-xr-x
2025-09-10 09:31
vz7_check_a2_templates_mount.sh
940
B
-rwxr-xr-x
2025-09-10 09:31
vz7_check_a2_zombie-procs.sh
768
B
-rwxr-xr-x
2025-09-10 09:31
vz7_check_nfs_kill.sh
1000
B
-rwxr-xr-x
2025-09-10 09:31
Save
Rename
#!/usr/bin/python # -*- coding:utf-8 -*- #### # # NAME: check_smartarray.py # # AUTHOR: Christophe Robert - christophe °dot° robert °at° cocoche °dot° fr # # DESC: Check HP SmartArray RAID status on Linux - hpacucli/hpssacli/ssacli command line tool # # Script compatibility : Python 2+ # Return Values : # No problems - OK (exit code 0) # Drive status != OK but not "Failed" - WARNING (exit code 1) # Drive status is "Failed" - CRITICAL (exit code 2) # # TODO : Script errors - UNKNOWN (exit code 3) # # VERSION: 1.0 - Initial dev. - 09-02-2012 (02 Sept. 2012) # 1.1 - Correcting some errors and add comments - 09-15-2013 (15 Sept. 2013) # * Add SAS array to be considerated (only SATA was before) # * Add comments # * Add UNKNOWN mark - script errors # 1.2 - Correcting some errors - 09-24-2013 (24 Sept. 2013) # * Add SCSI array to be considerated # * Add comments # 1.3 - Modify script from Windows PowerShell command tool to Python one's - 01-07-2015 (07 Jan. 2015) # 1.4 - Add controller, battery and cache status checks - 01-08-2015 (08 Jan. 2015) # 1.5 - Modify result analisys - 01-12-2015 (12 Jan. 2015) # 1.6 - Support for `hpacucli`, `hpssacli` and `ssacli` - 2018-02-22 (22. Feb. 2018) # #### import os import sys import re from subprocess import * import logging import logging.handlers class ReadHPSmartArrayStatus: def __init__(self, tuple, logger): self.nagios = tuple self.logger = logger #creation de table de hash qui permet d'associer une clé et une valeur self.system = {'ctrl': [], 'array': [], 'logical': [], 'physical': []} self.ctrl_nb = 0 self.array_nb = 0 self.lv_nb = 0 self.pd_nb = 0 def process(self): for element in self.nagios: sata = re.compile('^.*[Aa]rray.*SATA.*$') sas = re.compile('^.*[Aa]rray.*SAS.*$') scsi = re.compile('^.*[Aa]rray.*SCSI.*$') smart = re.compile('^Smart Array .*$') logical = re.compile('^.*logicaldrive.*$') physical = re.compile('^.*physicaldrive.*$') # Insert all controllers in dedicated list of dict if (smart.match(element)): self.logger.debug('--Debug-- Enter smart') self.logger.debug('--Debug-- Value = ' + element) self.ctrl_nb += 1 self.system['ctrl'].append(element) self.logger.debug('--Debug-- Dict :' + str(self.system)) # Insert all arrays in dedicated list of dict elif (sata.match(element) or sas.match(element) or scsi.match(element)): self.logger.debug('--Debug-- Enter array') self.logger.debug('--Debug-- Value = ' + element) self.array_nb += 1 self.system['array'].append(element) self.logger.debug('--Debug-- Dict :' + str(self.system)) # Insert all logicaldrives in dedicated list of dict elif (logical.match(element)): self.logger.debug('--Debug-- Enter logical') self.logger.debug('--Debug-- Value = ' + element) # Add the next logical drive to the previous array dict self.lv_nb += 1 self.system['logical'].append(element) self.logger.debug('--Debug-- Dict :' + str(self.system)) # Insert all physicaldives in dedicated list of dict elif (physical.match(element)): self.logger.debug('--Debug-- Enter physical') self.logger.debug('--Debug-- Value = ' + element) # Add the next physical drive to the previous logical drive dict self.pd_nb += 1 self.system['physical'].append(element) self.logger.debug('--Debug-- Dict :' + str(self.system)) self.logger.debug('--Debug-- Show "system" dict content') self.logger.debug('--Debug-- Value = ' + str(self.system)) return self.system class GetErrors: def __init__(self, buffer, logger): self.errors = {'CRITICAL': [], 'WARNING': [], 'UNKNOWN': []} self.tocheck = buffer self.logger = logger self.nb_ctrl = 0 self.nb_array = 0 self.nb_logical = 0 self.nb_physical = 0 def check(self): sata = re.compile('^.*array.*SATA.*$') sas = re.compile('^.*array.*SAS.*$') scsi = re.compile('^.*array.*SCSI.*$') logical = re.compile('^.*logicaldrive.*$') physical = re.compile('^.*physicaldrive.*$') # For each controller found, check errors and find S/N for i in range(len(self.tocheck['ctrl'])): self.logger.debug('--Debug-- Controller : ' + str(self.tocheck['ctrl'][i])) self.nb_ctrl += 1 #self.logger.debug('--Debug-- S/N : ' + self.tocheck['ctrl'][i].split('sn: ')[1].split(')')[0]) self.logger.debug('--Debug-- Slot : ' + self.tocheck['ctrl'][i].split('Slot ')[1].split(' ')[0]) ctrl_status = Popen(['sudo', smartarray_bin, 'ctrl', 'slot=' + self.tocheck['ctrl'][i].split('Slot ')[1].split(' ')[0], 'show', 'status'], stdout=PIPE) res = ctrl_status.communicate()[0] ctrl_status.stdout.close() ctrl = [] for r in res.splitlines(): r = r.lstrip() logger.debug(str(r)) if (r != ''): ctrl.append(r) self.logger.debug('--Debug-- Controller internal status : ' + str(ctrl)) for element in ctrl: if re.compile('.*Status:.*').match(element): self.logger.debug('--Debug-- Controller element status : ' + element) if element.split(': ')[1].split('\n')[0] != 'OK': self.errors['WARNING'].append(element) # For each array found, check errors for i in range(len(self.tocheck['array'])): self.logger.debug('--Debug-- Enter "array"') self.logger.debug('--Debug-- Value = ' + str(self.tocheck['array'][i])) self.nb_array += 1 # For each logicaldrive found, check errors for i in range(len(self.tocheck['logical'])): self.logger.debug('--Debug-- Enter "logicaldrive"') self.logger.debug('--Debug-- Value = ' + str(self.tocheck['logical'][i])) self.nb_logical += 1 if re.compile('^.*OK.*$').match(self.tocheck['logical'][i]): self.logger.debug(re.compile('^.*OK.*$').match(self.tocheck['logical'][i])) pass elif re.compile('^.*Failed.*$').match(self.tocheck['logical'][i]): self.logger.debug(re.compile('^.*Failed.*$').match(self.tocheck['logical'][i])) self.errors['CRITICAL'].append(self.tocheck['logical'][i]) elif re.compile('^.*Recover.*$').match(self.tocheck['logical'][i]): self.logger.debug(re.compile('^.*Recover.*$').match(self.tocheck['logical'][i])) self.errors['WARNING'].append(self.tocheck['logical'][i]) else: self.logger.debug(self.tocheck['logical'][i]) self.errors['UNKNOWN'].append(self.tocheck['logical'][i]) # For each logicaldrive found, check errors for i in range(len(self.tocheck['physical'])): self.logger.debug('--Debug-- Enter "physicaldrive"') self.logger.debug('--Debug-- Value = ' + str(self.tocheck['physical'][i])) self.nb_physical += 1 if re.compile('^.*OK.*$').match(self.tocheck['physical'][i]): self.logger.debug(re.compile('^.*OK.*$').match(self.tocheck['physical'][i])) pass elif re.compile('^.*Failed.*$').match(self.tocheck['physical'][i]): self.logger.debug(re.compile('^.*Failed.*$').match(self.tocheck['physical'][i])) self.errors['CRITICAL'].append(self.tocheck['physical'][i]) elif re.compile('^.*Rebuilding.*$').match(self.tocheck['physical'][i]): self.logger.debug(re.compile('^.*Rebuilding.*$').match(self.tocheck['physical'][i])) self.errors['WARNING'].append(self.tocheck['physical'][i]) else: self.logger.debug(self.tocheck['physical'][i]) self.errors['UNKNOWN'].append(self.tocheck['physical'][i]) self.logger.debug('--Debug-- Errors dict : ' + str(self.errors)) return self.errors, self.nb_ctrl, self.nb_array, self.nb_logical, self.nb_physical ### Core ### logger = logging.getLogger('check_smartarray') logger.setLevel(logging.DEBUG) handler = logging.handlers.SysLogHandler(address='/dev/log') logger.addHandler(handler) # Check which HP SmartArray management utility is installed if os.path.isfile('/usr/sbin/hpacucli'): smartarray_bin = 'hpacucli' elif os.path.isfile('/usr/sbin/hpssacli'): smartarray_bin = 'hpssacli' elif os.path.isfile('/usr/sbin/ssacli'): smartarray_bin = 'ssacli' else: logger.debug('--Debug-- HP SmartArray management utility not found.') sys.exit(2) # Get array status from SmartArray management utility hpacucli = Popen(['sudo', smartarray_bin, 'ctrl', 'all', 'show', 'config'], stdout=PIPE) res = hpacucli.communicate()[0] hpacucli.stdout.close() nagios = [] for r in res.splitlines(): r = r.lstrip() logger.debug(str(r)) if (r != ''): nagios.append(r) logger.debug('--Debug-- List command results :') logger.debug(nagios) nb_warning = 0 nb_critical = 0 nb_unknown = 0 tosend = "" try: # Parse and analyse returned lines state = ReadHPSmartArrayStatus(nagios, logger) config = state.process() # Check errors errors = GetErrors(config, logger) health, nb_ctrl, nb_array, nb_logical, nb_physical = errors.check() logger.debug('--Debug-- Health dict : ' + str(health)) if len(health['CRITICAL']): logger.debug('--Debug-- Enter critical') nb_critical += 1 for l in range(len(health['CRITICAL'])): tosend += 'CRITICAL - ' + health['CRITICAL'][l] + '\n' elif len(health['WARNING']) and nb_critical==0: logger.debug('--Debug-- Enter warning') nb_warning += 1 for l in range(len(health['WARNING'])): tosend += 'WARNING - ' + health['WARNING'][l] + '\n' elif len(health['UNKNOWN']) and nb_critical==0 and nb_warning==0: logger.debug('--Debug-- Enter unknown') nb_unknown += 1 for l in range(len(health['UNKNOWN'])): tosend += 'UNKNOWN - ' + health['UNKNOWN'][l] + '\n' elif nb_ctrl == 0 or nb_array == 0 or nb_logical == 0 or nb_physical == 0: logger.debug('--Debug-- Enter unknown') nb_unknown += 1 tosend += 'UNKNOWN - One of element of these : controller (' + str(nb_ctrl) + '), array (' + str(nb_array) + '), logicaldrive (' + str(nb_logical) + ') or physicaldrive (' +str(nb_physical) + ') is missing !\n' else: tosend = 'OK - RAID status is good - Nb Ctrl : ' + str(nb_ctrl) + ' - Nb Array : ' + str(nb_array) + ' - Nb logicaldrive : ' + str(nb_logical) + ' - Nb physicaldrive : ' + str(nb_physical) tosend = tosend.strip('^\n') logger.debug(str(tosend)) except Exception as e: tosend = str(e) logger.debug('--Debug-- Exception : ' + tosend) print('--Debug-- Exception : ' + tosend) finally: print(str(tosend)) if nb_critical != 0: raise SystemExit, 2 elif nb_warning != 0: raise SystemExit, 1 elif nb_unknown != 0: raise SystemExit, 3 else: raise SystemExit, 0 sys.exit(0)