ZABBIX Forums  
  #1  
Old 11-12-2015, 14:01
michael.weber michael.weber is offline
Member
 
Join Date: Nov 2015
Posts: 81
Default Template for HP MSA 2040 (external check)

Hi all,
i created, based on Emir Imamagics HP P2000 G3 Template a new one for MSA2040 because his did not work on my System.

First of all: i used Emir Imamagics Script snippets. If you dont agree please just delete this thread.

For your hosts you Need to specific 2 macros:
{$MSA1} = hostname/ip Controller 1
{$MSA2} = hostname/ip Controller 2

the request are perfmored with an external script hp-msa.pl

In the script please specific the username+password for the MSA API user.

Almost everything will be Auto discovered:
- enclosure
- disks
- vdisks
- Volumes

Triggers for almost everything are definded.

Important: allow HTTP Access, actuall i have issues with HTTPS. So you Need to active HTTP on the msa.

Feel free to come back with Feedback or improvments

Update:
Thanks @varnav
Template with Bugfixes here:

https://share.zabbix.com/storage-devices/hp/hp-msa

Please use varnavs Version.
Attached Files
File Type: zip Template.zip (4.6 KB, 727 views)

Last edited by michael.weber; 16-03-2016 at 12:20.
Reply With Quote
  #2  
Old 14-12-2015, 10:57
RepkinMS RepkinMS is offline
Junior Member
 
Join Date: Dec 2015
Posts: 4
Default Error

Hi. Big thanks for your work.
command:
perl /usr/local/share/zabbix/externalscripts/hp-msa.pl 192.168.X.X lld
answers:
Use of uninitialized value $ARGV[2] in string eq at /usr/local/share/zabbix/externalscripts/hp-msa.pl line 115.
Use of uninitialized value $ARGV[2] in string eq at /usr/local/share/zabbix/externalscripts/hp-msa.pl line 118.
Use of uninitialized value $ARGV[2] in string eq at /usr/local/share/zabbix/externalscripts/hp-msa.pl line 121.
Use of uninitialized value $ARGV[2] in string eq at /usr/local/share/zabbix/externalscripts/hp-msa.pl line 124.
Use of uninitialized value $ARGV[2] in string eq at /usr/local/share/zabbix/externalscripts/hp-msa.pl line 127.
{
"data" : []
}

Can you help me with it?
Also, can you tell about "ICMP status" in Value mapping?
Reply With Quote
  #3  
Old 14-12-2015, 11:26
michael.weber michael.weber is offline
Member
 
Join Date: Nov 2015
Posts: 81
Default

Hi, of Course!
you Need to add a additionla Argument for the lld to tell the script about the items you want to discover.
Code:
root@**-s-zab01:/usr/local/share/zabbix/externalscripts# ./hp-msa.pl 192.168.1.94 lld controller
{
   "data" : [
      {
         "{#CLASS}" : "Controller",
         "{#KEY}" : "A"
      },
      {
         "{#KEY}" : "B",
         "{#CLASS}" : "Controller"
      }
   ]
}

the idea behind ICMP Check:
Both Macros for the Host {$MSA1} and {$MSA2} and checked with ICMP to verify the availability of the Controllers.
BUT the other checks are only performed on the {$MSA1}.
so: if MSA2 goes down, you will get a ICMP error and additional Information with the other checks.
if MSA1 goes down NO check will be performed because the script cant connect to the ip. But you will get a alert because of the ICMP check on MSA1.

if you have any further questions just let me know
Reply With Quote
  #4  
Old 15-12-2015, 09:52
RepkinMS RepkinMS is offline
Junior Member
 
Join Date: Dec 2015
Posts: 4
Default

Thanks. All good, all working fine, but only from command line my zabbix-server says at discover rules: "Value should be a JSON object."
i tried different methods to convert to JSON, but result is nothing. JSON output correct.
Today i upgraded zabbix server from 2.4.3 to 2.4.7, error non go away Do you have any idea?
michael.weber you have zabbix 3.0 and all working fine?
Reply With Quote
  #5  
Old 15-12-2015, 10:24
michael.weber michael.weber is offline
Member
 
Join Date: Nov 2015
Posts: 81
Default

i have zabbix 3.0 Alpha

if zabbix say that it should be a json please check the Output.
Can you copy&paste your command + Output into a CODE Tag so i can recheck the Output

here two example command for LLD and DATA (both are required), i highlighted the output:
Note: lld command Needs JSON Format, data Output ONLY the Value

Code:
root@hai-s-zab01:/usr/local/share/zabbix/externalscripts# ./hp-msa.pl 192.168.1.94 lld enclosure
{
   "data" : [
      {
         "{#CLASS}" : "Enclosure",
         "{#KEY}" : "2"
      },
      {
         "{#CLASS}" : "Enclosure",
         "{#KEY}" : "1"
      }
   ]
}

root@hai-s-zab01:/usr/local/share/zabbix/externalscripts# ./hp-msa.pl 192.168.1.94 data enclosure 2 health
OKroot@hai-s-zab01:/usr/local/share/zabbix/externalscripts#
Reply With Quote
  #6  
Old 15-12-2015, 10:51
RepkinMS RepkinMS is offline
Junior Member
 
Join Date: Dec 2015
Posts: 4
Default

Ho-ho. It`s my stupid mistake. Before download you script to zabbix i edit it in notepad+ and at the and of each row appeared symbol "^M" are not displayed in nano. Discover now working.
Big thanks for your work and help. Good luck.
Reply With Quote
  #7  
Old 22-01-2016, 05:31
pfsenses-vl pfsenses-vl is offline
Junior Member
 
Join Date: Jan 2016
Posts: 2
Default

I have Zabbix 2.4.7. And I also have problem with "Value should be a JSON object".
This is result of LLD command:
Code:
zabbix@zabbix:~$ perl /usr/lib/zabbix/externalscripts/hp-msa.pl 192.168.73.23 lld enclosure

{
   "data" : [
      {
         "{#KEY}" : "Enclosure",
         "{#CLASS}" : "1"
      },
      {
         "{#CLASS}" : "2",
         "{#KEY}" : "Enclosure"
      }
   ]
}
This is result of DATA command:
Code:
zabbix@zabbix:~$ perl /usr/lib/zabbix/externalscripts/hp-msa.pl 192.168.73.23 data enclosure 2 health

OKzabbix@zabbix:~$
I try to edit pl script in Notepad++, nano, mcedit. But this problem not solved.

Also, I have "Unknown import version" problem, but i solve it, when i change "Zabbix Export Version" from 3.0 to 2.0.
Reply With Quote
  #8  
Old 26-01-2016, 19:17
michael.weber michael.weber is offline
Member
 
Join Date: Nov 2015
Posts: 81
Default

Everything is fine
Check the Output line:
Quote:
zabbix@zabbix:~$ perl /usr/lib/zabbix/externalscripts/hp-msa.pl 192.168.73.23 data enclosure 2 health

OKzabbix@zabbix:~$
You get a "OK" from the MSA, so the enclosure 2 health is fine!

The Export Version is correct, sorry for that. I exported it with the Zabbix 3.0 Alpha Version.
Reply With Quote
  #9  
Old 27-01-2016, 02:52
pfsenses-vl pfsenses-vl is offline
Junior Member
 
Join Date: Jan 2016
Posts: 2
Default

Quote:
Originally Posted by michael.weber View Post
Everything is fine
Check the Output line:


You get a "OK" from the MSA, so the enclosure 2 health is fine!

The Export Version is correct, sorry for that. I exported it with the Zabbix 3.0 Alpha Version.
I know, that enclosure is fine. But template isn't working in my zabbix version.
I try to solve this problem, and ask you, why zabbix show this errors?
LLD command show correct JSON data, isn't it?
Maybe upgrade my zabbix to 3.0 can solve this problem?
Reply With Quote
  #10  
Old 07-02-2016, 01:07
michael.weber michael.weber is offline
Member
 
Join Date: Nov 2015
Posts: 81
Default

Please check the Server logs. In my logs i can see that sometimes to execution time for the script just to high and zabbix kills it. Can you check this?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 11:44.