SUMMARY: Appending to /var/adm/messages

From: Vahid Moghaddasi (sunman@ureach.com)
Date: Tue Sep 23 2003 - 17:41:00 EDT


Hi and thank you all,
I have received may replies which I can not list, of course I
received more out-of-office and Spam block than answers. I guess
I have to use /usr/bin/logger rather than a device in /dev/
directory. The only problem is that I run healthcheck to look
for different problems e.g. "myhealthcheck.ksh | grep ERROR" and
would like to redirect the output to /var/adm/messages. Here are
a few answers which I would like to share:

Jay Lessert
Accelerant Networks Inc. wrote:

On Mon, Sep 22, 2003 at 10:34:43PM -0400, Vahid Moghaddasi
wrote:
> Hi everyone,
> Is there a device on Solaris to write to /var/adm/messages? I
am
> looking for a way to append to log without having to redirect
> the output by '>>'

Good, because that would be a bad thing to do.

> the two devices /dev/msglog and /dev/sysmsg
> do not what I need them to do.

The bottom line is that syslogd owns /var/adm/messages, and the
correct
thing to do is to ask syslogd to log the messages for you.

>From a shell script, you call logger(1).

>From a C/C++ program, you call
openlog(3C)/syslog(3C)/closelog(3C).

>From Perl, there is the Sys::Syslog module.

-- 
Christopher L. Barnard wrote:
logger -p Priority "message here"
"message here" will go into whatever log file the syslog.conf
says to
put messages of the specified priority into.
So according to my syslog,
*.err;kern.debug;daemon.notice;mail.crit       
/var/adm/messages
So if I execute the command
(~) shalmaneser 128 % logger -p daemon.notice "test message to
syslog"
(~) shalmaneser 131 % tail -1 /var/adm/messages
Sep 23 07:43:49 shalmaneser cbar44: [ID 702911 daemon.notice]
test message to syslog
________________________________________________
Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag
---- Vahid Moghaddasi sunman@ureach.com wrote ----
> Date: Mon, 22 Sep 2003 22:34:43 -0400
> To: " Sun-Managers" <sunmanagers@sunmanagers.org>
> From: Vahid Moghaddasi <sunman@ureach.com>
> Subject: Appending to /var/adm/messages
> Reply-To: sunman@ureach.com
> 
> 
> Hi everyone,
> Is there a device on Solaris to write to /var/adm/messages? I
am
> looking for a way to append to log without having to redirect
> the output by '>>' the two devices /dev/msglog and
/dev/sysmsg
> do not what I need them to do.
> Thank you,
> Vahid.
> 
> ________________________________________________
> Get your own "800" number
> Voicemail, fax, email, and a lot more
> http://www.ureach.com/reg/tag
> _______________________________________________
> sunmanagers mailing list
> sunmanagers@sunmanagers.org
> http://www.sunmanagers.org/mailman/listinfo/sunmanagers
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers


This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:27:10 EDT