Networker

Re: [Networker] nsradmin, jobquery script

2011-10-20 12:24:59
Subject: Re: [Networker] nsradmin, jobquery script
From: Tim Mooney <Tim.Mooney AT NDSU DOT EDU>
To: NETWORKER AT LISTSERV.TEMPLE DOT EDU
Date: Thu, 20 Oct 2011 11:23:48 -0500
In regard to: [Networker] nsradmin, jobquery script, gergogyerek said (at...:

I'd like to write a script that can be used to check the morning status
of the backup zones without the GUI.  The output should contain:
status;group name; last run; % complete (!); -> basically what's shown
on the GUI.

If you want what the GUI shows but without the GUI, then take a look at
running gstclreport from a script and using one of its export format
options (I use CSV and then parse that).

Something like (in perl):

my $report='/Reports/NetWorker Backup Status/Save Set Details by Client';
my $servers='your_server_here';
my $statuses='failed,incomplete,unexpectedly exited';

my @cmd = ( '/opt/lgtonmc/bin/gstclreport',
        '-u', $conf->user(),
        '-P', $conf->password(),
        '-f', $temp_file,
        '-o', 'landscape',
        '-x', 'csv',
        '-r', $report,
        '-C', 'Server Name', $servers,
        '-C', 'Status', $statuses,
        '-C', 'Group Start Time', '1 day'
);

my $ret_val = system(@cmd) / 256;

and then parse appropriately.

Tim
--
Tim Mooney                                             Tim.Mooney AT ndsu DOT 
edu
Enterprise Computing & Infrastructure                  701-231-1076 (Voice)
Room 242-J6, IACC Building                             701-231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164

To sign off this list, send email to listserv AT listserv.temple DOT edu and type 
"signoff networker" in the body of the email. Please write to networker-request 
AT listserv.temple DOT edu if you have any problems with this list. You can access the 
archives at http://listserv.temple.edu/archives/networker.html or
via RSS at http://listserv.temple.edu/cgi-bin/wa?RSS&L=NETWORKER

<Prev in Thread] Current Thread [Next in Thread>