On RHEL 7.2, I created below script in cronjob for every minute. If this process is found to be not running, it should record message in /var/adm/xymessages, start it and send email.
But logger part is not working, seems like I am missing something. It should pick hostname also. Probably I am missing an entry in rsyslog.conf ?
Quote:
[root@test-servs ~]# logger -p 'XY 6990 - ERC API on `hostname` is restarted' /var/adm/xymessages
logger: unknown priority name: XY 6990 - ERC API on `hostname` is restarted.
[root@test-servs ~]#
[root@test-servs ~]# cat /etc/rsyslog.conf | grep -v "#"
$WorkDirectory /var/lib/rsyslog
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
$IncludeConfig /etc/rsyslog.d/*.conf
$OmitLocalLogging on
$IMJournalStateFile imjournal.state
*.info;mail.none;authpriv.none;cron.none /var/log/messages
authpriv.* /var/log/secure
mail.* -/var/log/maillog
cron.* /var/log/cron
*.emerg musrmsg:*
uucp,news.crit /var/log/spooler
local7.* /var/log/boot.log
[root@test-servs ~]#
Hi I have a command in a script .
/usr/bin/iostat -E
I would like to place an entry in /var/adm/messages (via syslog) as a daemon.notice using the logger command but i just cant work out the syntax for this , do I pipe the output of iostat into logger? or is it redirected...can somebody give me... (1 Reply)
Generally(at least on AIX5.3, Solaris9, OS X)'logger' command would create syslog messages which carry <login name> . On Solaris9, I have experienced two circumstances in which 'logname' command fails. In this circumstance I saw the 'logger' command generated syslog messages which carry... (0 Replies)
Hi,
I Have downloaded script for pfiles command, It is written to make it run on Linux, But I could not make out on which language it is written,kindly help me in executing this script:(
link: http://sourceware.org/systemtap/examples/process/pfiles.stp (1 Reply)
Hi everyone,
when executing this command in unix:
echo "WM7 Fatal Alerts:", $(cat query1.txt) > a.csvIt works fine, but running this command in a shell script gives an error saying that there's a syntax error.
here is content of my script:
tdbsrvr$ vi hc.sh
"hc.sh" 22 lines, 509... (4 Replies)
Hello.
I would like to ask your help regarding the cp command. We are using a cp command to create a back-up copy of our file but to no avail. It's just not working. We already checked the file and directory permissions and all seems correct.
We have a script (ftp.script) which calls on... (1 Reply)
when i am using Mailx command from AIX box, i am getting the following errors :
uuencode: not found.
mailx: not found.
but when i executed the mailx command as shown below it worked
cat /etc/hosts | mailx -v -s "test email" user@server.com
It works fine in the production server.
... (2 Replies)
I use the snippet below in /etc/profile on RHEL Linux to capture command line logging and it all works well and good.
Now I'd like to pipe the same output from script through the logger command so it all gets logged to syslog.
The only additional code I've added is in bold below (|... (4 Replies)
Hi everyone
I have a problem with my script
If I try directly this command
/usr/bin/nice -n 19 mysqldump -u root --password="******" wiki_schneider -c | nice -n 19 gzip -9 > /point_de_montage/$(date '+%Y%m%d')-wiki-db.sql.gz
It works
But if I simply add this command in a script and... (8 Replies)
HI
I have and echo command which works perfectly in the shell but when i execute in the script it gives me an error code
query is as below
QUERY=`echo "Select Severity,Dupl_count,Creation_Time,Last_Received,Node_Name,Node_Name,Object,Message_Group,Message_Text,Last_Annotation from " \
... (2 Replies)
Hello i am having an issue with bash script and this is the code
now=$(cat hosts1.txt | awk '{print $2;}')
while read n ;do
ssh root@$now 'useradd test1; echo -e "test1\ntest1" | passwd test1 && echo "test1 ALL=(ALL:ALL) ALL" >> /etc/sudoers'
When i execute only part with cat, it... (8 Replies)
Discussion started by: tomislav91
8 Replies
LEARN ABOUT OSF1
accton
acctprc(8) System Manager's Manual acctprc(8)NAME
acctprc1, acctprc2, accton - Perform process-accounting procedures
SYNOPSIS
acctprc1 [InFile]
acctprc2
accton [OutFile]
DESCRIPTION
The three acctprc commands, acctprc1, acctprc2, and accton, are used in the runacct shell procedure to produce process-accounting reports.
acctprc1 [InFile]
The acctprc1 command is used to read records from standard input that are in a format defined by the acct structure in the
/usr/include/sys/acct.h header file. This process adds the login names that correspond to user IDs, and then writes corresponding ASCII
records to standard output. For each process, the record format includes the following seven unheaded columns: The user ID column includes
both traditional and assigned user identification numbers listed in the /etc/passwd file. The login name is the one used for the user ID
in the /etc/passwd file. The number of seconds the process consumed when executed during prime-time hours. Prime-time and nonprime-time
hours are defined in the /usr/sbin/acct/holidays file. The number of seconds the process consumed when executed during nonprime-time
hours. Total number of characters transferred. Total number of blocks read and written. Mean memory size (in kilobyte units).
When specified, InFile contains a list of login sessions in a format defined by the utmp structure in the /usr/include/utmp.h header file.
The login session records are sorted according to user ID and login name. When InFile is not specified, acctprc1 gets login names from the
password file /etc/passwd. The information in InFile is used to distinguish different login names that share the same user ID.
acctprc2
The acctprc2 command reads, from standard input, the records written by acctprc1, summarizes them according to user ID and name, and writes
sorted summaries to standard output as total accounting records in the tacct format (see the acctmerg command).
accton [OutFile]
When no parameters are specified with the accton command, account processing is turned off. When you specify an existing OutFile file,
process accounting is turned on, and the kernel adds records to that file. You must specify an Outfile to start process accounting. Many
shell script procedures expect the file name /var/adm/pacct, the standard process-accounting file.
EXAMPLES
To add a user name to each process-accounting record in a binary file and then write these modified binary-file records to an ASCII file
named out.file, enter the following line to an accounting shell script:
/usr/sbin/acct/acctprc1 < /var/adm/pacct >out.file
A user name is added to each record. The raw data in the pacct file is converted to ASCII and added to file out.file. To produce a
total binary accounting record of the ASCII output file out.file produced in example 1, enter the following line to an accounting
shell script:
/usr/sbin/acct/acctprc2 < out.file > /var/adm/acct/nite/daytacct
The resulting binary total accounting file, written in the acct format, contains records sorted by user ID. This sorted user ID
file, is usually merged with other total accounting records when an acctmerg command is processed to produce a daily summary
accounting record called /var/adm/acct/sum/daytacct. To turn on process accounting, enter:
/usr/sbin/acct/accton /var/adm/pacct To turn off process accounting, enter:
/usr/sbin/acct/accton
FILES
Specifies the command path. Specifies the command path. Specifies the command path.
RELATED INFORMATION
Commands: acct(8), acctcms(8), acctmerg(8), runacct(8)
Functions: acct(2) delim off
acctprc(8)