ZABBIX Forums  

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

Reply
 
Thread Tools Display Modes
  #1  
Old 27-02-2012, 22:43
parabola parabola is offline
Junior Member
 
Join Date: Sep 2009
Posts: 13
Smile [BETA RELEASE] IBM Tivoli Storage Manager

Hello!
This is the first release of my TSM monitoring script/template I've created for Zabbix. This has been tested on TSM 5x and zabbix 1.8x. Its been doing what I need for some time now. I finally got around to cleaning it up There will be updates as time goes on, on my end and as bugs/features get reported.


NOTE: The script_update.zip is NOT required if you're not currently using the product!

06.21.2012 - 1.0 BETA 2
FEATURES
  • Currently 28 datapoints collected
  • 9 predefined triggers
  • 7 predefined graphs
  • Automated tape consolidation
TODO
  • Clean up script (theres some nasty 'sed' and 'awk' going on in there )
  • Remove dependency on internal TSM scripts
  • Get alerts for failed backups (right now the alerts are generated and sent to a ticketing system, zabbix is unaware of which hosts had failed backups, just that there WERE failed backups, and how many, unless you utilize the ticketing system feature, or add your own jazz into the while loop for failed backups)
Known Issues
  • A few of the functions are built upon a builtin TSM script(included in download). This dependency will hopefully be removed in the next release.
UPDATES:
  • (02/28/2012) - I've found an issue in the no data received trigger, I've updated the download. I've also provided the updated trigger value.
    Quote:
    {Template_Tivoli_Storage_Manager:tsm.nodes.count.n odata(3600)}=1
  • (04/20/2012) - I found a coding mistake in the script, namely I was writing both failed, and missed backup count to the same variable. the key and item already exists in your template, so simply replacing the .sh file will suffice, or if you're comfortable modify the "tsm_failedjobs" function changing "send_value tsm.jobs.missed' to ".failed"
  • (06/21/2012) - ToomasAas found some logic issues and has fixed them, the original download has been updated.
Feedback welcome, my contact info is in the script, as are the instructions for installation/use.
Attached Files
File Type: zip tsm_zabbix_beta2 _6.21.2012.zip (7.0 KB, 269 views)

Last edited by parabola; 21-06-2012 at 16:49.
Reply With Quote
  #2  
Old 28-02-2012, 00:59
parabola parabola is offline
Junior Member
 
Join Date: Sep 2009
Posts: 13
Default

Here are some screenshots:




Reply With Quote
  #3  
Old 05-03-2012, 20:40
dougbee dougbee is offline
Member
 
Join Date: Apr 2011
Posts: 58
Default

Hi parabola,

My TSM admin skills are a bit rusty (it's been years) - so I'm working with our resident TSM admin to get things going. As our config is quite a bit different (we're on 6.3, have a library manager, etc) I'm going to start adding items one-by-one.

I decided to start with the diskpools. How long are your volume_names? When I query mine, it's full filepath - 45 characters in one case. So the command:

send_value tsm.pools."${disk-5)}" "$num"
(ignore the unhappy face, it's getting parsed by the forum!)
ends up with an itemname that isn't "tsm.pools.disk1", and instead is a bit garbled.

Perhaps the length is irrelevant, as I think I'm going to have to manually create the items to accurately reflect the disk names. I'm wondering if there should be some sort of "profiling" script that builds the template with the specific diskpools after querying the TSM server. It's something I'll ponder..
Reply With Quote
  #4  
Old 30-03-2012, 16:06
parabola parabola is offline
Junior Member
 
Join Date: Sep 2009
Posts: 13
Default

Quote:
Originally Posted by dougbee View Post
Hi parabola,

My TSM admin skills are a bit rusty (it's been years) - so I'm working with our resident TSM admin to get things going. As our config is quite a bit different (we're on 6.3, have a library manager, etc) I'm going to start adding items one-by-one.

I decided to start with the diskpools. How long are your volume_names? When I query mine, it's full filepath - 45 characters in one case. So the command:

send_value tsm.pools."${disk-5)}" "$num"
(ignore the unhappy face, it's getting parsed by the forum!)
ends up with an itemname that isn't "tsm.pools.disk1", and instead is a bit garbled.

Perhaps the length is irrelevant, as I think I'm going to have to manually create the items to accurately reflect the disk names. I'm wondering if there should be some sort of "profiling" script that builds the template with the specific diskpools after querying the TSM server. It's something I'll ponder..
Doug, my apologies on my late response!
Regarding the disk names, yes you are correct, that will need to be modified, heres one of mine "/dev/rtsmlvdisk1" so the -5 grabs just "disk1" . So the length will need to be changed depending on how much of the name you want it to grab. I'm working on a release of this that will hopefully be more "out of the box" friendly, with less configuration needed, however I'm running into some obvious issues with that. (every environment is radically different)

if you need help with any of the scripting stuff send me a message on the forums, or in IRC (same nick)
Reply With Quote
  #5  
Old 30-03-2012, 16:15
dougbee dougbee is offline
Member
 
Join Date: Apr 2011
Posts: 58
Default

No problem, in fact your lack of response had me go out on my own!

I found that you can use a "-dataonly=yes" parameter for dsmadmc, which simplifies the scripting quite a bit, and should leave it more version-independent...
Reply With Quote
  #6  
Old 30-03-2012, 17:50
parabola parabola is offline
Junior Member
 
Join Date: Sep 2009
Posts: 13
Default

Quote:
Originally Posted by dougbee View Post
No problem, in fact your lack of response had me go out on my own!

I found that you can use a "-dataonly=yes" parameter for dsmadmc, which simplifies the scripting quite a bit, and should leave it more version-independent...
Nice find! I will play with that and see what I can do with it, if you make any good changes to it, please feel free to update and attach or send to me and i'll update the original post with your updated version (with credits!)
Reply With Quote
  #7  
Old 04-04-2012, 08:59
vlam vlam is offline
Member
 
Join Date: Jun 2009
Posts: 55
Default Help

Can you guys please help with a brieve description on how to impliment this please.

I have a Zabbix server, with a Zabbix proxy in the client environment and then a TSM server that I want to monitor.

Please Please help
Reply With Quote
  #8  
Old 08-04-2012, 06:37
parabola parabola is offline
Junior Member
 
Join Date: Sep 2009
Posts: 13
Default

Quote:
Originally Posted by vlam View Post
Can you guys please help with a brieve description on how to impliment this please.

I have a Zabbix server, with a Zabbix proxy in the client environment and then a TSM server that I want to monitor.

Please Please help
ylam,
The script can be placed anywhere, and will need to be scheduled with cron. The script uses the TSM client to run SQL queries against TSM, the returned data is then sent via the zabbix_sender binary.

Due to the complex nature of a backup environment, this is not a simple drop in solution, a few things will need to be modified, (disk pool names, login..ect) but stuff is commented and if you're unsure of any part of the script feel free to ask (you'll get quicker responses on IRC )
Reply With Quote
  #9  
Old 29-05-2012, 10:47
ToomasAas ToomasAas is offline
Junior Member
 
Join Date: Apr 2012
Posts: 8
Default Different implementation of tsm_summary_24hrs

I'm implementing this solution and so far find it extremely awesome.

I am running TSM server 6.2, and noticed that in my case the statistics gathered by tsm_summary_24hrs function are not correct, because results output by the TSM SELECT query are not in the order in which the function expects them to be and wrong values are getting assigned to wrong items. So I re-wrote the function in a way that is hopefully more independent from the version of TSM. Note that this also changes the item names (they are in uppercase as returned by TSM), so item names in the template need to be adjusted accordingly. Some 'interesting' statistics are probably missing because they were not present in my TSM server at the moment, but they are easy enough to add.

Code:
function tsm_summary_24hrs { 
        summary=$(tsm_cmd "SELECT activity,cast(float(sum(bytes))/1024/1024/1024 as dec(8,2)) as "GB" FROM summary
 where end_time>current_timestamp-24 hours GROUP BY activity")

        for jobtype in ARCHIVE BACKUP INCR_DBBACKUP FULL_DBBACKUP MIGRATION RECLAMATION
        do
                send_value tsm.summary.daily.$jobtype $(echo "$summary" | grep $jobtype | awk {'print $2'})
        done
}
Reply With Quote
  #10  
Old 21-06-2012, 10:16
ToomasAas ToomasAas is offline
Junior Member
 
Join Date: Apr 2012
Posts: 8
Default A thought about tsm_missedjobs and tsm_failedjobs

I noticed that functions tsm_missedjobs and tsm_failedjobs send no data if there are no missed/failed jobs. This means, that if there is one missed job one day, the value of 'missed jobs' in TSM is set to 1 and it remains to 1, even though next day there are no failed jobs. Maybe some people prefer this behaviour, but I added a simple "else" statement to the if/endif construction in tsm_missedjobs:

Code:
        if [[ $(echo $missedLog) == *Missed* ]]; then
                echo "$missedLog" > tsmPipeMissed &
                while read line; do
                        missedInt=$(($missedInt+1))
                        tsm_failed_subject="Monitoring - TSM - Missed backup for  host $(echo $line | awk '{print $3}')"
                        open_ticket "$line"
                done < tsmPipeMissed
                send_value tsm.jobs.missed "$missedInt"
                rm -f tsmPipeMissed
+        else
+               send_value tsm.jobs.missed 0
        fi
Similarly in tsm_failedjobs, only with another key name.

This way, if there are no missed/failed jobs the item gets set to 0 and the trigger is cleared.
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 03:26.