- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Script help in translating idea to script in ksh.
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-11-2002 08:35 AM
тАО09-11-2002 08:35 AM
I have been given a task to create a script that would do the following items.
1) Take errors from DMESG, /var/adm/messages, and /var/adm/syslog/syslog.log and roll them into one file, local file would be a starting point on about 20 different systems.
2) Take the local files that are created on every system containing all the errors from those other logfiles and bringing them into one system.
3) Take the local files from each system which would be named based on the system name it came from, and then combine all 20 files into one report that would be emailed to a specific group list.
Any ideas on this would be a help. Thank you in advance.
fg.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-11-2002 08:45 AM
тАО09-11-2002 08:45 AM
Solution*.err;kern.debug;daemon.notice;auth.notice;user.none @centralserver
which will forward a copy of those message types to your centralserver for logging. A local copy will still be kept.
Then you look through the one centralized file for error messages. Each message should be tagged with the system name that it comes from, so you will know which system had the error.
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-11-2002 08:53 AM
тАО09-11-2002 08:53 AM
Re: Script help in translating idea to script in ksh.
HTH
mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-11-2002 09:22 AM
тАО09-11-2002 09:22 AM
Re: Script help in translating idea to script in ksh.
I want to clarify one point that I am trying to accomplish, that is the point that all I want to take out of the current syslog, dmesg, and /var/adm/messages files are ERRORS that occurr (not the entire log files). These errors would then be written to the system (ERROR log file) on each system. Then I would like to take those (ERROR LOG FILES) from each system and bring them into one big (ERROR LOG FILE), then email that one file.
Thanks again for the suggestions so far.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-11-2002 09:48 AM
тАО09-11-2002 09:48 AM
Re: Script help in translating idea to script in ksh.
You can selectively forward messages by setting that line in /etc/syslog.conf. If you do a "man syslogd" and "man logger" you will see the different severity levels (*.crit, *.emerg, *.err, ...) that you can choose from. And you can eliminate some classes with constructs like "user.none".
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-11-2002 10:25 AM
тАО09-11-2002 10:25 AM
Re: Script help in translating idea to script in ksh.
Try this.
##
LOGDIR=/home/system/log
for host in hp01 hp02 hp03 hp04
{
remsh $host "dmesg" >> $LOGDIR/$host-log
remsh $host "cat /var/adm/messages" >> $LOGDIR/$host-log
remsh $host "cat /var/adm/syslog/syslog.log" >> $LOGDIR/$host-log
}
DATE=`date +%d%b%Y`
cat $LOGDIR/hp*-log >> $LOGDIR/HPLOG.$DATE
uuencode LOGDIR/HPLOG.$DATE HPLOG |mailx -m -s "HP LOGS" user@domain.com
##
Not tested..
You can modify as you need.
Thanks.
Prashant.