<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Logger Command in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/logger-command/m-p/2593002#M33115</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Within your script, check the return code of commands, e.g. to check if a file exists:&lt;BR /&gt;&lt;BR /&gt;test -f /tmp/dummy&lt;BR /&gt;if [ $? -eq 0 ] ; then&lt;BR /&gt; logger "/tmp/dummy exists"&lt;BR /&gt;else&lt;BR /&gt; logger "/tmp/dummy missing"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;When you wish to terminate a script, use the "exit" command to set the return code.  You can then test this as above, and log accordingly.&lt;BR /&gt;&lt;BR /&gt;Rgds, Robin.</description>
    <pubDate>Thu, 11 Oct 2001 06:51:01 GMT</pubDate>
    <dc:creator>Robin Wakefield</dc:creator>
    <dc:date>2001-10-11T06:51:01Z</dc:date>
    <item>
      <title>Logger Command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/logger-command/m-p/2592998#M33111</link>
      <description>Hai &lt;BR /&gt;&lt;BR /&gt;I am running one script which will automatically run by using cronjob..So i need to use the LOGGER in HP-Unix command to automatically return the status of that file to SYSLOG.LOG&lt;BR /&gt;&lt;BR /&gt;Can anyone help me how to use this LOGGER command...</description>
      <pubDate>Thu, 11 Oct 2001 06:33:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/logger-command/m-p/2592998#M33111</guid>
      <dc:creator>Rajkumar_3</dc:creator>
      <dc:date>2001-10-11T06:33:27Z</dc:date>
    </item>
    <item>
      <title>Re: Logger Command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/logger-command/m-p/2592999#M33112</link>
      <description>&lt;BR /&gt;/usr/bin/logger "this is a test" will produce the fpllowing entry in /var/adm/syslog/syslog.log&lt;BR /&gt;&lt;BR /&gt; Oct 11 09:37:16 mars bongartz: this is a test &lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Rainer</description>
      <pubDate>Thu, 11 Oct 2001 06:37:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/logger-command/m-p/2592999#M33112</guid>
      <dc:creator>Rainer von Bongartz</dc:creator>
      <dc:date>2001-10-11T06:37:36Z</dc:date>
    </item>
    <item>
      <title>Re: Logger Command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/logger-command/m-p/2593000#M33113</link>
      <description>Hai rainer Von&lt;BR /&gt;&lt;BR /&gt;Thank you for your reply..&lt;BR /&gt;&lt;BR /&gt;So if i include this command : &lt;BR /&gt;/usr/bin/logger "The test is successfull"&lt;BR /&gt;in my shell script ,it will automatically returns to the syslog..&lt;BR /&gt;&lt;BR /&gt;How can i identify whether that script is successfull or not successfull ?? How can i check the condition in the shell script..??&lt;BR /&gt;&lt;BR /&gt;Thanks for the advance in help.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Rajkumar&lt;BR /&gt;</description>
      <pubDate>Thu, 11 Oct 2001 06:45:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/logger-command/m-p/2593000#M33113</guid>
      <dc:creator>Rajkumar_3</dc:creator>
      <dc:date>2001-10-11T06:45:01Z</dc:date>
    </item>
    <item>
      <title>Re: Logger Command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/logger-command/m-p/2593001#M33114</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;As a quick test, type:&lt;BR /&gt;&lt;BR /&gt;logger hello&lt;BR /&gt;&lt;BR /&gt;This should add a line to /var/adm/syslog/syslog.log&lt;BR /&gt;&lt;BR /&gt;You can control which logfile to send to using the -p switch.  This will send to the logfile as configured in syslog.conf, so:&lt;BR /&gt;&lt;BR /&gt;echo hello | logger -d mail.debug&lt;BR /&gt;&lt;BR /&gt;will probably end up in /var/adm/syslog/mail.log because of the line:&lt;BR /&gt;&lt;BR /&gt;mail.debug      /var/adm/syslog/mail.log&lt;BR /&gt;&lt;BR /&gt;in syslog.conf.  You can also dump the contents of a file (-f), add the process id (-i), change the tag (-t).&lt;BR /&gt;&lt;BR /&gt;I'd just play around with it, and keep another window open that is tailing the logfiles:&lt;BR /&gt;&lt;BR /&gt;tail -f /var/adm/syslog/syslog.log (or whatever).&lt;BR /&gt;&lt;BR /&gt;Also "man 1 logger".&lt;BR /&gt;&lt;BR /&gt;Rgds, Robin.&lt;BR /&gt;</description>
      <pubDate>Thu, 11 Oct 2001 06:45:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/logger-command/m-p/2593001#M33114</guid>
      <dc:creator>Robin Wakefield</dc:creator>
      <dc:date>2001-10-11T06:45:23Z</dc:date>
    </item>
    <item>
      <title>Re: Logger Command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/logger-command/m-p/2593002#M33115</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Within your script, check the return code of commands, e.g. to check if a file exists:&lt;BR /&gt;&lt;BR /&gt;test -f /tmp/dummy&lt;BR /&gt;if [ $? -eq 0 ] ; then&lt;BR /&gt; logger "/tmp/dummy exists"&lt;BR /&gt;else&lt;BR /&gt; logger "/tmp/dummy missing"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;When you wish to terminate a script, use the "exit" command to set the return code.  You can then test this as above, and log accordingly.&lt;BR /&gt;&lt;BR /&gt;Rgds, Robin.</description>
      <pubDate>Thu, 11 Oct 2001 06:51:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/logger-command/m-p/2593002#M33115</guid>
      <dc:creator>Robin Wakefield</dc:creator>
      <dc:date>2001-10-11T06:51:01Z</dc:date>
    </item>
    <item>
      <title>Re: Logger Command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/logger-command/m-p/2593003#M33116</link>
      <description>status of your scripts depends very much on what you are doing there.&lt;BR /&gt;yout script should check the return values (echo $?) of the commands.&lt;BR /&gt;&lt;BR /&gt; if [[ $? != 0 ]]&lt;BR /&gt; then&lt;BR /&gt;     print "cmd not OK!"&lt;BR /&gt; else&lt;BR /&gt;     print "cmd ok "&lt;BR /&gt; fi &lt;BR /&gt;&lt;BR /&gt;or something like this&lt;BR /&gt;&lt;BR /&gt;Reagards&lt;BR /&gt;Rainer   &lt;BR /&gt;</description>
      <pubDate>Thu, 11 Oct 2001 06:53:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/logger-command/m-p/2593003#M33116</guid>
      <dc:creator>Rainer von Bongartz</dc:creator>
      <dc:date>2001-10-11T06:53:36Z</dc:date>
    </item>
    <item>
      <title>Re: Logger Command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/logger-command/m-p/2593004#M33117</link>
      <description>it should of course read&lt;BR /&gt;&lt;BR /&gt;logger "cmd not ok" instead of&lt;BR /&gt;print "cmd not ok"</description>
      <pubDate>Thu, 11 Oct 2001 06:56:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/logger-command/m-p/2593004#M33117</guid>
      <dc:creator>Rainer von Bongartz</dc:creator>
      <dc:date>2001-10-11T06:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: Logger Command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/logger-command/m-p/2593005#M33118</link>
      <description>Hai All,&lt;BR /&gt;&lt;BR /&gt;I will try now with all the option that you all have given to me and let you know the results..&lt;BR /&gt;&lt;BR /&gt;Thanking you&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Rajkumar</description>
      <pubDate>Thu, 11 Oct 2001 07:47:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/logger-command/m-p/2593005#M33118</guid>
      <dc:creator>Rajkumar_3</dc:creator>
      <dc:date>2001-10-11T07:47:20Z</dc:date>
    </item>
    <item>
      <title>Re: Logger Command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/logger-command/m-p/2593006#M33119</link>
      <description>Also, you should be able to specify the facility and level for syslog in the logger command.  So for example if you want to treat your script failures as an error condition you could do something such as:&lt;BR /&gt;if [[ $? != 0 ]] &lt;BR /&gt;then &lt;BR /&gt;   logger -p user.err "cmd not OK!" &lt;BR /&gt;else &lt;BR /&gt;   logger -p user.notice "cmd ok " &lt;BR /&gt;fi &lt;BR /&gt;&lt;BR /&gt;-Santosh</description>
      <pubDate>Thu, 11 Oct 2001 08:11:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/logger-command/m-p/2593006#M33119</guid>
      <dc:creator>Santosh Nair_1</dc:creator>
      <dc:date>2001-10-11T08:11:22Z</dc:date>
    </item>
    <item>
      <title>Re: Logger Command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/logger-command/m-p/2593007#M33120</link>
      <description>Hai,&lt;BR /&gt;&lt;BR /&gt;Thank you all for the Help..&lt;BR /&gt;&lt;BR /&gt;Thanks &amp;amp; Regards&lt;BR /&gt;Rajkumar</description>
      <pubDate>Fri, 12 Oct 2001 02:50:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/logger-command/m-p/2593007#M33120</guid>
      <dc:creator>Rajkumar_3</dc:creator>
      <dc:date>2001-10-12T02:50:35Z</dc:date>
    </item>
  </channel>
</rss>

