[Contents] [Prev] [Next] [Index] [Report an Error]

Verifying the Commit Script Syslog Output

System log messages are generated during a commit operation but not during a commit check operation. This means you cannot use the commit check | display xml and commit check | display detail configuration mode commands to verify the output of system log messages.

To test the output of a system log message, make sure that the candidate configuration contains the condition that elicits the system log message. In this example, ensure that the read-write statement is not included at the [edit snmp community community-name authorization] hierarchy level.

To test the example in this chapter, perform the following steps:

  1. Copy the XSLT script into a text file, and name the file read-write.xsl. Depending on whether you save your commit script files to the flash drive or the hard drive, copy the read-write.xsl file to the config/scripts/commit or the /var/db/scripts/commit directory on your routing platform.
  2. Include the file read-write.xsl statement at the [edit system scripts commit] hierarchy level:
    user@host> edit
    [edit]

    user@host# set system scripts commit file read-write.xsl
  3. If the read-write statement is included at the [edit snmp community community-name authorization] hierarchy level, issue the following configuration mode command:
    [edit]

    user@host# delete snmp community community-name authorization read-write
  4. Ensure that system logging is configured by issuing the following configuration mode command:
    [edit]

    user@host# show system syslog

    For information about system log configuration, see the JUNOS System Log Messages Reference.

  5. Issue the commit command:
    [edit]

    user@host# commit

After you issue the commit command, check the log file. The default directory for log files is /var/log. A common filename for the log file is messages. Commit script system log entries look like this:

    
timestamp router-id cscript: message

For example:

    Jun 3 14:34:37 router cscript: SNMP community does not have read-write access

[Contents] [Prev] [Next] [Index] [Report an Error]