Some time ago, I posted that EMC had added a jobquery utility to allow probing of the NetWorker jobs database (the one created/maintained by nsrjobd). Unfortunately, at the time, jobquery had been somewhat muzzled – you could give it commands, and it would spit output back to you, but it would never give you any indication that it was waiting for you. No prompting, no nothing. It made working with jobquery somewhat of a hassle.
Thankfully though, as of NetWorker 7.6, the duct tape has been fully removed and jobquery will happily give you that meta-information:
[root@nox ~]# jobqueryNetWorker jobs query utility.Use the "help" command for help.jobquery> helpLegal commands are:print [query] (set current query)show [attrlist]typesallquithelp [command]. [query]? [command]Where:query ::= attrlistattrlist ::= attribute [; attribute]*attribute ::= name [: [value [, value]* ]jobquery> typesKnown types: job indication, save job, probe job,savegroup job, session info, index save job,savefs job, bootstrap save job, utility job,active job db;
Now sure, in previous versions you could type commands in and get output, but not having the prompt to tell you when jobquery was waiting, or when it was working, or when (as I originally thought) it was hanging on startup, is a fairly critical part in having a useful user interface.
Having a responsive user interface makes jobquery a little nicer to work with. For instance, let’s look at the “save job” type and run a backup. There’s a lot of fields in the “save job” resource type, so I’m going to limit it as follows:
jobquery> show command:; group name:; host:; job state:; level: jobquery> print type: save job command: "save -s nox.anywebdb.com -g "Staging Servers" -LL -f - -m nox -t 1262601936 -l incr -q -W 78 -N /d/nsr/01 /d/nsr/01"; group name: Staging Servers; host: nox; job state: COMPLETED; level: incr;
Then, once the backup starts, if I run (and abbreviate the output, remembering it shows all jobs in the database!), I can see:
command: savepnpc -s nox.anywebdb.com -g archon -LL -f - -m archon -t 1262818820 -l in cr -q -W 78 -N / /; group name: archon; host: archon; job state: ACTIVE; level: incr;
However, the “ACTIVE” state simply means that the job is actively queued, not that it’s actually sending data. If you want to only see jobs that are actively backing up rather than just simply active, you’d look for a job state of “SESSION ACTIVE”:
jobquery> print type: save job; job state: SESSION ACTIVE command: savepnpc -s nox.anywebdb.com -g archon -LL -f - -m archon -t 1262818820 -l in cr -q -W 78 -N / /; group name: archon; host: archon; job state: SESSION ACTIVE; level: incr; command: savepnpc -s nox.anywebdb.com -g archon -LL -f - -m archon -t 1262818814 -l in cr -q -W 78 -N /Volumes/Yu /Volumes/Yu; group name: archon; host: archon; job state: SESSION ACTIVE; level: incr;