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:
user@host> edit
[edit]
user@host# set system scripts commit file read-write.xsl
[edit]
user@host# delete snmp community community-name authorization read-write
[edit]
user@host# show system syslog
For information about system log configuration, see the JUNOS System Log Messages Reference.
[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