[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference decwet::networker

Title:NetWorker
Notice:kits - 12-14, problem reporting - 41.*, basics 1-100
Moderator:DECWET::RANDALL.com::lenox
Created:Thu Oct 10 1996
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:750
Total number of notes:3361

493.0. "Writing to /nsr/logs/messages from a script" by SANITY::LEMONS (And we thank you for your support.) Fri Mar 14 1997 13:20

    Hi
    
    I'm writing a UNIX script to automate a cloning function done at my
    site.  I'd like to write some messages produced by this script to
    /nsr/logs/messages.  Any suggestions on:
    
    1) should I do this?
    2) how can I do this?
    
    Thanks!
    tl
T.RTitleUserPersonal
Name
DateLines
493.1DECWET::RWALKERRoger Walker - Media ChangersFri Mar 14 1997 14:415
	NetWorker uses the syslogd daemon to send messages to the
	log files.  That's why other daemon messages can end up
	in the same file.  The only way I know to get messages there
	is via the syslog(3) call.  I don't know if this can be
	done from the shell without a program.
493.2One way...DECWET::FARLEEInsufficient Virtual um...er....Fri Mar 14 1997 16:2512
If you're not shy about using undocumented utilities, and if
your script runs with root permissions, you can use the
nsrlog command to insert entries in messages.log.

a'la:

nsrlog << EOF
Ok
I'm done now with my backup job.
EOF

You can see nsrlog being used in the notifications that NetWorker uses.
493.3SANITY::LEMONSAnd we thank you for your support.Fri Mar 14 1997 19:465
    Yippee!  Just what the doctor ordered!  Thanks, also, for including a
    code sample.  I'll use that in my script.
    
    Thanks again!
    tl
493.4SANITY::LEMONSAnd we thank you for your support.Sun Mar 16 1997 20:065
    Er, where _is_ nsrlog?  I did a quick look around, and didn't find it
    on my system.
    
    Thanks!
    tl
493.5DECWET::FARLEEInsufficient Virtual um...er....Mon Mar 17 1997 09:4411
Err... Sorry.

It's in the development tree that I am working on...

In the 4.2B release, you'll see the same functionality being 
accomplished by /usr/bin/logger -p daemon.notice

Check out the notification resource for "log default"
and the man page for logger.

Kevin
493.6SANITY::LEMONSAnd we thank you for your support.Mon Mar 17 1997 13:3612
    Hi Kevin
    
    Neat!  Thanks for the pointer.  Here's an oddity:  the DU V4.0A logger
    man page mentions:
    
    	-p priority[.facility]
    
    and shows a priority of notice and a facility of daemon; this, to me,
    should yield '-p notice:daemon', not '-p daemon.notice'.  Any opinion?
    
    Thanks again!
    tl
493.7perlLEXSS1::GINGERRon GingerMon Mar 24 1997 08:442
    perl scripts have no trouble writing to the syslogd. just open it and
    write away.
493.8SANITY::LEMONSAnd we thank you for your support.Wed May 21 1997 15:2417
    Hi
    
    What 'logger' command should I use to write informational messages
    (created during execution of a script that does cloning) to the
    NetWorker log file(s)?
    
    Should I write to messages or daemon.log?
    
    I'm guessing I need something like:
    
    /usr/bin/logger -f /usr/logs/messages -p daemon.notice Beginning
    cloning for ${client_line}
    
    Thoughts?
    
    Thanks
    tl
493.9DECWET::KAOYun Kao - NSR EngineerWed May 21 1997 16:183
It looks good to me.

I would write to /nsr/logs/messages since all the daemon.notice goes there.