|
SUMMARY: Appending to /var/adm/messages: msg#00125os.solaris.managers.summaries
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@xxxxxxxxxx wrote ---- > Date: Mon, 22 Sep 2003 22:34:43 -0400 > To: " Sun-Managers" <sunmanagers@xxxxxxxxxxxxxxx> > From: Vahid Moghaddasi <sunman@xxxxxxxxxx> > Subject: Appending to /var/adm/messages > Reply-To: sunman@xxxxxxxxxx > > > 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@xxxxxxxxxxxxxxx > http://www.sunmanagers.org/mailman/listinfo/sunmanagers |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | SUMMARY: Adding a NIC to a Sun Blade: 00125, Jeff Allen |
|---|---|
| Next by Date: | SUMMARY:Add DIMMS memory: 00125, Becerril, Mario Henley |
| Previous by Thread: | SUMMARY: Adding a NIC to a Sun Bladei: 00125, Jeff Allen |
| Next by Thread: | SUMMARY:Add DIMMS memory: 00125, Becerril, Mario Henley |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |