Ad Widget

Collapse

Create Check for server-x that gets data from server-y

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • benhanson
    Junior Member
    • Feb 2012
    • 17

    #1

    Create Check for server-x that gets data from server-y

    Not sure if this is possible, but I have the following scenario.

    Using Commvault for a backup solution, I'd like to add a template item for all my hosts that shows the last backup size. I have a sql query that will return the correct data when supplied with a hostname parameter, and have this query set up as a UserParameter on the SQL server.

    Is there a way to have an 'item' associated with a template that pulls data from a different server?

    So, template has 'item', server-x is linked to template, check for 'item' linked to server-x executes, it queries server-y with 'server-x' as a parameter of the query.

    I could run a script on the backup server that would drop some sort of stat file on each backed up server, but I thought querying the backup server directly would be cleaner.
  • benhanson
    Junior Member
    • Feb 2012
    • 17

    #2
    Commvault Last 30 Day incrementals

    I ended up solving this, had to do the following:

    On the commvault server, there is a SQL view called CommCellBkupSizeInfo. Referencing this, I added a UserParameter to the zabbix agent on my commvault server, something like:

    -------
    UserParameter=db_cvBackupStats[*],sqlcmd -S tcp:<cvServerName>\commvault -h -1 -W -Q "SET NOCOUNT ON; SELECT TotalIncBkpSizeGB from commserv.dbo.CommCellBkupSizeInfo where clientname='$1'"
    --------
    Then, on my Zabbix server, I created a shell script that uses zabbix_get to grab data from commvault, something like . . .

    --------
    #!/bin/bash
    SERVER=$2
    HOSTNAME=`echo $SERVER |awk -F. '{ print $1}'`
    zabbix_get -s <cvServerName> -k db_cvBackupStats[$HOSTNAME]
    --------

    I had to use awk to strip the fqdn because Commvault expects a short name for 'clientname'

    The above script didn't work until I un-commented the ExternalScripts parameter in zabbix_server.conf and fixed permissions on it (chown zabbix:zabbix ...)

    Lastly, I had to create the item on my windows template. Item is an external check, with a key of <scriptName>[{HOSTNAME}] and type of information 'Numeric(Float)'

    Adding the {HOSTNAME} parameter was required, as many of my hosts came through as IP addresses before I did so, and Commvault needed a client name. {HOSTNAME} had to be capitalized to work.

    Now I'm happily logging the size of the last 30 day's incremental backups for my servers, and eventually will add triggers for big jumps in backup sizes. Maybe some more granular details as well(last backup job size).

    Comment

    Working...