A.12 Querylog Utility

The querylog lets you view recent cluster events. Events can be node specific (a node joined or left the cluster) or they can be resource specific (a resource changed state from loading to running)

You can specify a relative date range (a period of time that is relative to the current date) to find log records. Specifying the relative date range enables you save your queries and execute them as and when required without needing to alter the date range. Examples of relative date range: 10 days ago, Yesterday, Last Friday, and so forth.

A.12.1 Syntax

/opt/novell/ncs/bin/querylog [-ehiow] [-aAbB date][-n name] [-l number]

Enter the command at a terminal console prompt as the root user or any other user in admin or ncsgroup. If the command succeeds, the log entries are displayed.

A.12.2 Options

-a date

Prints all the log entries made on the specified date and continues until the date and time the command was executed.

-b date

Prints all the log entries made on and before the specified date. The output includes the entries since NCS started logging events until the specified date.

-A date

Prints all the log entries made after the specified date. The entries made before and on the specified date are excluded.

-B date

Prints all the log entries made before the specified date. The entries made on and after the specified date are excluded.

-h

Prints the help page.

-l number

Limits the output to the number of entries or lines.

-o

Prints the oldest log entry first.

-n name

Specify the name of the resource or node for which you want to view logs.

-i

Filters and prints only the informative log entries.

-w

Filters and prints only the warning log entries.

-e

Filters and prints only the error log entries.

A.12.3 Examples

This program normally runs as root.

/opt/novell/ncs/bin/querylog

Prints all the log entries since NCS started logging events until the date and time the command was executed.

The output will be in a reverse chronological order, which means the most recent event is displayed first.

/opt/novell/ncs/bin/querylog -oe -B 'yesterday 16:44'

Prints all the error log entries made before 16:44 the previous day from the current date.

The output will be in a chronological order, which means the oldest entry is displayed first.

/opt/novell/ncs/bin/querylog -w -e -a '10 days ago' -b '10/21/2014 14:23' -n name_of_resource_1 -n name_of_resource_2 -n name_of_node1 -o -l66

Filters and prints up to 166 error and warning log entries for the specified node(s) and resource(s).

The output will be in a chronological order, which means the oldest entry is displayed first.

The output includes all the log entries made in the past 10 days, that is, 14:23 October 11, 2014 until 14:23 on October 21, 2014. The log entries made at 14:23 on October 21, 2014 and after are excluded.