ZABBIX Forums  

Go Back   ZABBIX Forums > Zabbix Discussions and Feedback > Zabbix Cookbook

Reply
 
Thread Tools Display Modes
  #11  
Old 13-12-2013, 14:54
ArtemK ArtemK is offline
Senior Member
 
Join Date: May 2013
Posts: 229
Default

Hello,

I've tested it on 2.x server/agent, also works on 2.2. Not sure that it will work for 1.x (never used it)

you should substitute $1 variables with your actual configuration, this is what discovery script can make for you (create all items in zabbix)

but you can run once discovery script, which will create file /tmp/raid-discovery-zsend-data.tmp ($tmp_path in discovery script). This file contains discovery data for zabbix. Using it you can check smth on command line

i.e. discovery data file
Code:
[root@host ~]# cat /tmp/raid-discovery-zsend-data.tmp
- intel.raid.discovery.pdisks { "data":[{ "{#ENCLOSURE_ID}":"252", "{#PDRIVE_ID}":"1", "{#ADAPTER_ID}":"0" },{ "{#ENCLOSURE_ID}":"252", "{#PDRIVE_ID}":"3",
....
so, you can run, for example, such command:
Code:
[root@host ~]# perl -w /etc/zabbix/scripts/raid_check.pl -mode pdisk -item 'firmware_state' -adapter 0 -enclosure 252 -pdisk 3
Online, Spun Up
[root@host ~]#
BTW, I made another version of this scripts, which actively uses trapper items (and I'm using it currently), works better for me, than active agents check (win powershell script sometimes gives empty value, not sure why)

Last edited by ArtemK; 13-12-2013 at 14:57.
Reply With Quote
  #12  
Old 15-12-2013, 15:44
neo4is neo4is is offline
Junior Member
 
Join Date: Dec 2013
Posts: 5
Send a message via Skype™ to neo4is
Default

Hi
Many thanks for your reply.

I have checked the agent on my server linux, it is 1.8.2 and no support. On another linux server with 2.0.9, the script runs well.

As you mentioned, you are using another version of this script which can run with passive agent on windows and linux? Could you please to share your script.
Reply With Quote
  #13  
Old 17-12-2013, 09:37
ArtemK ArtemK is offline
Senior Member
 
Join Date: May 2013
Posts: 229
Default

UPD 17.12.2013

I've added template with trapper items for physical/logical disks and BBU. Personally I use that version now, cause powershell script on windows sometimes returns empty values for physical disk checks (not sure why), and item changes state to unsupported. That is annoying. In this version I use scheduled tasks for discovery (every hour) and reporting (every 5 minutes, raid_trapper_check script).

NB, adapter checks type is still 'active agent'. There is also trigger for BBU, which uses nodata() (it will report, if no data coming from monitored host). You will need to make similar trigger for physical disk, for example, if there is no BBU on adapter.

also, there are some small bugs fixed (and maybe more added)

Download from github

Code review will be appreciated

Last edited by ArtemK; 03-06-2017 at 22:23.
Reply With Quote
  #14  
Old 17-12-2013, 09:44
ArtemK ArtemK is offline
Senior Member
 
Join Date: May 2013
Posts: 229
Default

Quote:
Originally Posted by neo4is View Post
I have checked the agent on my server linux, it is 1.8.2 and no support. On another linux server with 2.0.9, the script runs well.
I don't really understand what are you talking about, which script? AFAIK, 1.8 also supports UserParameters and perl/powershell scripts doesn't require specific agent.

Quote:
Originally Posted by neo4is View Post
As you mentioned, you are using another version of this script which can run with passive agent on windows and linux? Could you please to share your script.
It's not passive agent, I've used trapper items there. See my previous message.
Reply With Quote
  #15  
Old 18-12-2013, 08:59
neo4is neo4is is offline
Junior Member
 
Join Date: Dec 2013
Posts: 5
Send a message via Skype™ to neo4is
Default

Quote:
Originally Posted by ArtemK View Post
I don't really understand what are you talking about, which script? AFAIK, 1.8 also supports UserParameters and perl/powershell scripts doesn't require specific agent.

I mean I can run your tool on windows (2.0.9 agent) but on linux (agent 1.8.2) in the zabbix server show me "Not Support" for Trigger, Item

It's not passive agent, I've used trapper items there. See my previous message.
Yours noted with thanks.
Reply With Quote
  #16  
Old 18-12-2013, 09:04
neo4is neo4is is offline
Junior Member
 
Join Date: Dec 2013
Posts: 5
Send a message via Skype™ to neo4is
Default

It's not passive agent, I've used trapper items there. See my previous message.[/QUOTE]

You meand that you use raid_trapper_check.ps1 with same parameter in agent config?
Reply With Quote
  #17  
Old 18-12-2013, 10:46
ArtemK ArtemK is offline
Senior Member
 
Join Date: May 2013
Posts: 229
Default



I'm using raid_trapper_check.ps1 in scheduled task, but zabbix server also checks adapter items using zabbix agent active check, and key is defined as userparameter in agent config, if that is what you meant.
Reply With Quote
  #18  
Old 18-12-2013, 10:52
neo4is neo4is is offline
Junior Member
 
Join Date: Dec 2013
Posts: 5
Send a message via Skype™ to neo4is
Default

Quote:
Originally Posted by ArtemK View Post


I'm using raid_trapper_check.ps1 in scheduled task, but zabbix server also checks adapter items using zabbix agent active check, and key is defined as userparameter in agent config, if that is what you meant.
Yes, that is what I need. Thanks for your sharing.
Reply With Quote
  #19  
Old 20-12-2013, 13:21
timon_is_timon timon_is_timon is offline
Senior Member
 
Join Date: Dec 2012
Posts: 116
Default

can you write step by step instruction? when I run script raid_check.ps1 it ask me about paprameters... I take them, but...

PS C:\fs\zagent> .\raid_check.ps1

Командлет raid_check.ps1 в конвейере команд в позиции 1
Укажите значения для следующих параметров:
mode: pdisk
adapter: 0
Select-String : Не удается привязать аргумент к параметру "Pattern", так как он представляет собой пустую строку.
C:\fs\zagent\raid_check.ps1:57 знак:93
+ $output = (& $CLI -pdinfo -PhysDrv["$enclosure_id":"$disk_id"] -a $adapter | Select-String <<<< $regex -AllM
atches | % { $_.Matches } | % { $_.groups[1].value })
+ CategoryInfo : InvalidData: ( [Select-String], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllo wed,Microsoft.PowerShell.Commands.Sele
ctStringCommand

Last edited by timon_is_timon; 20-12-2013 at 13:27.
Reply With Quote
  #20  
Old 20-12-2013, 13:32
timon_is_timon timon_is_timon is offline
Senior Member
 
Join Date: Dec 2012
Posts: 116
Default

PS C:\fs\zagent> .\raid_trapper_check.ps1
info from server: "processed: 0; failed: 40; total: 40; seconds spent: 0.000707"
sent: 40; skipped: 0; total: 40
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 05:59.