NAME

      mxquery - add, list, modify, or remove queries in Systems Insight
      Manager


SYNOPSIS

      mxquery -a -f filename
      mxquery -m -f filename
      mxquery -r queryname ...
      mxquery -r -f filename
      mxquery -e queryname
      mxquery [ -l f|n|t] [queryname  ...]
      mxquery -l crit
      mxquery -l mode criterianame
      mxquery -l val criterianame


DESCRIPTION

      The mxquery command allows a Systems Insight Manager user to add,
      list, modify or remove queries in Systems Insight Manager.

      The first form of this command allows the user to add queries.  The
      information regarding the query is provided in a query definition file
      (see mxquery(4)) and allows the user to add one or more Systems
      Insight Manager queries.

      During an add operation, Systems Insight Manager only adds queries
      whose names do not reference queries currently in the Systems Insight
      Manager repository. If Systems Insight Manager detects a duplicate
      query, Systems Insight Manager will skip the duplicate query, but
      continue to add all non-duplicate queries. Skipping duplicate queries
      in this case does not affect the exit code.

      The second form of mxquery allows the user to modify the definition of
      one or more Systems Insight Manager queries.  The information
      regarding the query is provided in a query definition file.  When
      modifying a query, the user must either be the query's owner or be a
      full rights user.

      The third and fourth forms of mxquery allows the user to remove
      Systems Insight Manager queries.	Only a full rights user or the query
      owner may remove a query.	 If the user specifies a query name that
      does not correspond to a query in Systems Insight Manager, Systems
      Insight Manager notifies the user that it cannot remove the query and
      attempts to remove the next designated query. Skipping undefined
      queries in this case does not affect the exit code. The user may
      specify the queries as a list of query names, or a query definition
      file.

      The fifth form of mxquery allows the user to execute the specified
      query. The user must specify the name of an existing query to execute.
      The user must be authorized to execute the query against the managed
      systems that the query targets. (see mxauth(1M))
      The sixth form of mxquery allows the user to list Systems Insight
      Manager queries or to view the definitions of specified Systems
      Insight Manager queries. With no qualifiers, mxquery lists the names
      of all registered Systems Insight Manager queries. With the f
      qualifier, mxquery writes to stdout a complete Systems Insight Manager
      query definition (see mxquery(4)) for each Systems Insight Manager
      query. With the n qualifier, mxquery provides a list of all Systems
      Insight Manager query names (the same as no qualifier). With the t
      qualifier, mxquery gives a tabular listing showing some of the
      attributes of all registered Systems Insight Manager queries. The user
      may limit the query information by specifying one or more query names.

      The seventh form of mxquery lists the names of all of the query
      categories that the user may add queries to. To add a query, the query
      definition must contain a category from this list.

      The eigth form of mxquery lists the names of all Systems Insight
      Manager queries currently configured in the Systems Insight Manager
      repository.

      The ninth form of mxquery lists the names of criteria that may be
      specified for a query. Criteria specify the search values that Systems
      Insight Manager uses when executing a query. Some criteria have a list
      of defined values that must be used when specifying that given
      criteria. This command lists the criteria name and the query type in
      which the criteria may be specified. The next form of the mxquery
      command allows one to list the defined values for a given criteria.

      The tenth form of mxquery lists the operation modes or for a specified
      criteria.

      The eleventh form of mxquery lists the defined criteria values for the
      specified criteria. If the specified criteria does not have defined
      values, then Systems Insight Manager does not list any data.

    Options
      mxquery recognizes the following options:

	   -a		  Indicates that one or more Systems Insight Manager
			  queries, specified in a query definition file, are
			  to be added.

	   -m		  Indicates that one or more Systems Insight Manager
			  query definitions are to be replaced by the
			  definition in the specified query definition file.

	   -r		  Indicates that one or more Systems Insight Manager
			  queries are to be removed.

	   queryname	  Specifies the name of the Systems Insight Manager
			  query to be removed or listed.  Specification of
			  an undefined query name results in mxquery
			  operating on zero queries and an exit code of
			  SUCCESS. Specification of an invalid query name,
			  i.e. one that violates the rules for query names
			  (see mxquery(4)), results in an invalid name exit
			  code.

	   -f filename	  Specifies the path and name of a file that
			  contains the definition of one or more Systems
			  Insight Manager queries to be added, modified, or
			  removed.

	   -l f		  Displays a file-formatted listing of Systems
			  Insight Manager queries (this output may be used
			  as input to the -f option).

	   -l n		  Displays the names of Systems Insight Manager
			  queries.

	   -l t		  Displays a tabular list of Systems Insight Manager
			  queries and query attributes.

	   -l cat	  Displays a list of query categories to which the
			  user may add queries.

	   -l crit	  Displays a list of criteria with which the user
			  may construct queries.

	   -l mode	  Diplays a list of operation modes or operators
			  that may be used in association with a specified
			  criteria.

	   -l val	  Displays a list of defined values associated with
			  a specified criteria

	   criterianame	  Is the name of an existing criteria for which the
			  user requests additional information, such as
			  operation modes or defined values.

      Note: When duplicate options are specified (for example, -f file1 -
      f file2), the last instance of the option will be used by mxquery (in
      this example, file2).


RETURN VALUE

      mxquery returns one of the following values:

	     0		  Successful completion.
	     1		  Command line syntax error.
	     2		  Error in a file operation or parsing a file.
	    21		  Invalid name.

	   102		  Systems Insight Manager Repository error.
	   222		  Central Management Server (CMS) is not
			  initialized.
	   249		  Unable to connect to the session manager.
	   250		  Remote exception.


EXAMPLES

      This command adds the queries defined in the Systems Insight Manager
      query definition file named "/home/user1/defs/myquerydef".

	   mxquery -a -f /home/user1/defs/myquerydef

      This command modifies queries based on the Systems Insight Manager
      query definition file named "/home/user1/defs/myquerymods".

	   mxquery -m -f /home/user1/defs/myquerymods

      This command removes the Systems Insight Manager query called
      "badquery".

	   mxquery -r badquery

      This command removes queries based on the Systems Insight Manager
      query definition file named "/home/user1/defs/myquerymods".

	   mxquery -r -f /home/user1/defs/myquerymods

      This command displays the list of Systems Insight Manager querynames.

	   mxquery -ln

      This command displays a tabular listing of the Systems Insight Manager
      queries with column headings.

	   mxquery -lt

      This command displays the Systems Insight Manager queries in XML file
      format.

	   mxquery -lf

      This command displays the categories to which the user may save
      queries.

	   mxquery -lcat

      This command displays the criteria names and their associated query
      type.

	   mxquery -lcrit

      This command displays the operation modes associated with the criteria
      named "CriteriaByIPAddress".

	   mxquery -lmode CriteriaByIPAddress

      This command displays the defined criteria values for the criteria
      named "CriteriaByProductType".

	   mxquery -lval CriteriaByProductType


LIMITATIONS

      This command may only be run on the CMS.


AUTHOR

      mxquery was developed by the Hewlett-Packard Company.


SEE ALSO for HP-UX

      mxauth(1M) mxquery(4).


SEE ALSO for Linux

      mxauth(8) mxquery(4).