Jobquery finally gets the duct tape removed

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 ~]# jobquery
NetWorker jobs query utility.
Use the "help" command for help.
jobquery> help
Legal commands are:
print [query] (set current query)
show [attrlist]
types
all
quit
help [command]
. [query]
? [command]
Where:
query ::= attrlist
attrlist ::= attribute [; attribute]*
attribute ::= name [: [value [, value]* ]
jobquery> types
Known 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;
What does this mean? For a start, it provides a way of checking (outside of NMC) which jobs are currently queued to run, and which jobs are actually running. As is always the case, the better you can monitor regardless of circumstance, the more likely you are to be able to understand your server state. Now that jobquery however at least tells us when it’s waiting for input, I’m looking forward to properly exploring what it can do. I previously said that I anticipated it being a useful tool. Now I know it’s going to be a useful tool, and will do some further digging/testing and do a future posting on using it further to track activities.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.