Sponsored Content
Operating Systems Linux Red Hat Collecting logs by running command Post 302626963 by ajayyadavmca on Friday 20th of April 2012 03:47:56 AM
Old 04-20-2012
Collecting logs by running command

Hi, i am a general user of linux but we work mostly on windows next i am moving full time on linux.

here is my question:
We have product which consist or several subsystem each subsystem has one module to create logs file dump. and i am going to write that support dump tool.

we need to create a zip which consists of various logs file from our product basically for trouble shooting.

This zip consist of following:
1. static log files
2. run few command and create files
3. OS related logs which helps in analyzing system related issues.

Now what approach i have is will have one configuration file which consists of:
1. location of files
2. commands to run which create files

and each subsystem will have their configuration file so we can collect all logs. done. simple.

The approach looks very simple and i am sure many of you would have same requirement, just wanted to know if there is some tool/command/utility already available where i can define my configuration file and it can fit my requirement?
i have googled and found "rotatelog" can do few, there is "cfg2html" can do few things.. but not really sure if they fit wilth all my requirements.

Please let me also know your suggestions. thanks in advance, will be waiting for replies.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Process launched by user who logs out, continue running ?

Lets say a user starts a process (either a shell script or a Perl script) and before that process finishes, he logs out (either intentionaly or network problems or ...), does the process continu running ? Default shell is Korn. This is because at my job (being trained), there are tasks to run... (2 Replies)
Discussion started by: Browser_ice
2 Replies

2. Solaris

Where we can get the logs for a command execution successfully?

Hi, How to get the logs for successfully executing of a solaris command? Where the logs will be stored? How to know that the commands is executed successfully or not? Thanks, Susi. (4 Replies)
Discussion started by: susinthaa
4 Replies

3. UNIX for Dummies Questions & Answers

command logs

Is there a place were the system stores logs of command's? like does it log whatever changes I made? I'm using a Centos 5.x box Thank you (2 Replies)
Discussion started by: mcraul
2 Replies

4. UNIX for Advanced & Expert Users

How to find one partucular user logs when there are lots of users running on it

On my application there are lots of users are doing there work or tasks? ...In my SSH or in 'Putty' i am observing logs? Hot to observe one particular 'user' logs.. even through there are lots of users working on it? For EX: i am log in with use rid:nikhil@in.com. another one log in with... (4 Replies)
Discussion started by: ksr.test
4 Replies

5. Shell Programming and Scripting

script for reading logs of a script running on other UNIX server

Hi, I have a script, running on some outside firwall server and it's log of success or failure is maintained in a file. I want to write a script which ftp that server and reads that file and checks the logs and if failure , I will send mail notification. Please let meknow if I am not... (1 Reply)
Discussion started by: vandana.parwani
1 Replies

6. Shell Programming and Scripting

Searching set of string from Live Running Logs

Hey just need one simple syntax to search for the string from the Live Running Logs. The strings are placed in a $infile & everytime the script should pull each string from $infile and should provide as an input for grepping from Live running logs on a rotational basis. So here are the Contents... (14 Replies)
Discussion started by: raghunsi
14 Replies

7. UNIX for Advanced & Expert Users

Collecting job id from qsub command

Hello. Hopefully this is the right forum, did a search and found some similar questions here. I'm trying to find out if there is a way to get the job id while submitting a job using qsub. I want to monitor the list of active jobs using qstat and when my jobid is no longer on the active list, I... (3 Replies)
Discussion started by: aeoleon88
3 Replies

8. Shell Programming and Scripting

Collecting logs between two time stamps

Hi, please help me to collect the entire log files between two time stamp. for example, I am looking script to collect the entire log between "2015-03-27 15:59" to "2015-03-27 16:15" in the below sample log file. OS : RHEL 6.3 Date/Time : 24 hours format, the time is printing each log... (12 Replies)
Discussion started by: jerryknj
12 Replies

9. UNIX for Advanced & Expert Users

Syslog-ng not working not collecting logs on rhel

Hi, I need help on syslog-ng on RHEL 7.2. It is working as expected. As per configuration, it is supposed to create authlog, messages and xymessages daily in respective folder of date. But I can see only messages file and that is also not updating well. # ps -ef | grep -i syslog root 22954... (1 Reply)
Discussion started by: solaris_1977
1 Replies
sysconfigdb(8)						      System Manager's Manual						    sysconfigdb(8)

NAME
sysconfigdb - Manage the subsystem configuration database SYNOPSIS
/sbin/sysconfigdb -s /sbin/sysconfigdb {-a | -u} [-t target] -f file subsystem-name /sbin/sysconfigdb {-m | -r} [-t target] -f file [subsystem-name] /sbin/sysconfigdb -d [-t target] subsystem-name /sbin/sysconfigdb -l [-t target] [subsystem-name,...] Specifies a subsystem that contains the attributes you want to modify. The subsystem name and attributes are in a stanza-formatted input file. You must specify only one subsystem name when deleting (-d), adding (-a), or replacing (-u) a subsystem. In other cases, when you do not specify a subsystem name the operation is attempted for all the subsystems and attributes specified in the input file. FLAGS
Adds the specified subsystem entry to the target file. Deletes the specified subsystem entry from the target file. Specifies the input file, a stanza-formatted file that contains entries for one or more subsystems. The default target file is the /etc/sysconfigtab file. Specify another target file by using the -t target flag. Lists the specified subsystem entries in the target file. If you do not specify subsystem-name,... arguments, all subsystem entries in the target file are listed. The /etc/sysconfigtab file is the default target file. Merges subsystem attributes specified in the input file with the subsystem attributes in the target file. If you do not specify a subsys- tem-name argument, all subsystem entries in the input file are merged. The /etc/sysconfigtab file is the default target file. Removes the subsystem entries specified in the input file from the target file. The only entries removed are those which have attribute names and val- ues that exactly match those in the input file. If you do not specify a subsystem-name argument, all subsystem entries in the input file with exactly-matching attributes are removed from the target file. The /etc/sysconfigtab file is the default target database file. Syn- chronizes the /etc/sysconfigtab file and the in-memory configuration database by updating the in-memory database so that it matches the /etc/sysconfigtab file. Specifies the target file for the operation. If you do not specify this flag, the default target file is the /etc/sysconfigtab file. Replaces a subsystem entry in the target file with the subsystem entry specified in the input file. DESCRIPTION
The sysconfigdb command is used to manage the /etc/sysconfigtab subsystem configuration database. However, it can also be used to maintain any text file that has the same format as the /etc/sysconfigtab file. The file being managed by the sysconfigdb command is called the tar- get file. By default, the target file is the /etc/sysconfigtab file. To specify another file as a target file, use the -t file flag. To modify a target file, create an input stanza-formatted file, as described in stanza(4). This stanza file contains the name of one or more subsystems, each with a list of attributes and their values. When the target file is the /etc/sysconfigtab file, modifications you make to it are automatically synchronized into the in-memory subsys- tem configuration database. However, the subsystems are unchanged until the next time they are configured. When the target file is another file, there is no synchronization with the in-memory subsystem configuration database. For example, suppose you create the following file named table_mgr.stanza that defines the attributes for a subsystem named table_mgr_1 and a subsystem named tbl_mgr_2: table_mgr_1: size = 10 name = Ten Element Table tbl_mgr_2: size = 5 name = Five Element Table To add the contents of this file to the /etc/sysconfigtab database and to have those modifications synchronized with the in-memory configu- ration database, enter the following commands: # sysconfigdb -a -f table_mgr.stanza table_mgr_1 # sysconfigdb -a -f table_mgr.stanaz tbl_mgr_2 The above example does not change the value of attributes in the running kernel. To modify the value of attributes in the run- ning kernel you must do one of the following: Use the sysconfig -r command Unconfigure and reconfigure the subsystem that contains the attribute value Reboot your system Always use the sysconfigdb command to modify the /etc/sysconfigtab database as it automatically updates the in-memory copy of the database. This ensures that the kernel has immediate access to any changes. The file is also automatically merged during an update installation and changes will be merged into the new system. To add the contents of the file table_mgr.stanza to another text file named /etc/sampleconfigdb, enter the following command: # sysconfigdb -a -t /etc/sampleconfigdb -f table_mgr.stanza Because the output file is not the /etc/sysconfigtab file, the in-memory configuration data- base is not updated. RESTRICTIONS
You must be the root user to execute the commmand when the /etc/sysconfigtab file is the target file and the operation will modify it. EXAMPLES
The following list shows examples of using the sysconfigdb command: To replace an existing entry in the /etc/sysconfigtab file, use the -u flag: # sysconfigdb -u -f table_mgr.stanza table_mgr_1 The above command replaces the table_mgr_1 entry in the /etc/sysconfigtab file with the information in the table_mgr.stanza file for the table_mgr_1 subsystem. The command updates the in-memory copy of the subsystem configuration database to match the modified /etc/sysconfigtab file. To merge information in a stanza-formatted file with the /etc/sysconfigtab file, use the -m flag: # sysconfigdb -m -f table_mgr.stanza tbl_mgr_2 The above command merges the tbl_mgr_2 information from the table_mgr.stanza file with the information already in the tbl_mgr_2 entry in the /etc/sysconfigtab file. The command updates the in-memory copy of the subsystem configuration database to match the modified /etc/sysconfigtab file. To list the entry for a subsystem in the /etc/sysconfigtab file, use the -l flag: # sysconfigdb -l table_mgr_1 table_mgr_1: size = 10 name = Ten Element Table The above command does not update the in-memory copy of the subsystem configuration database. To delete the entry for a subsystem from the /etc/sysconfigtab file, use the -d flag: # sysconfigdb -d table_mgr_1 The above command deletes the table_mgr_1 entry from the /etc/sysconfigtab file and updates the in-mem- ory copy of the subsystem configuration database to match the modified /etc/sysconfigtab file. FILES
The subsystem configuration database RELATED INFORMATION
Commands: cfgmgr(8) sysconfig(8) Files: sysconfigtab(4), stanza(4) delim off sysconfigdb(8)
All times are GMT -4. The time now is 06:55 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy