Sponsored Content
Homework and Emergencies Emergency UNIX and Linux Support Mail notifications for sudo shows syntax error Post 302903197 by babinlonston on Monday 26th of May 2014 03:29:38 AM
Old 05-26-2014
Linux Mail notifications for sudo shows syntax error

Im Using Centos Version

Code:
[sysadmin@li406-64 ~]$ cat /etc/redhat-release 
CentOS release 6.4 (Final)

I'm Using Sudo Version

Code:
[sysadmin@backup-srv ~]$ sudo -V
Sudo version 1.8.6p3
Sudoers policy plugin version 1.8.6p3
Sudoers file grammar version 42
Sudoers I/O plugin version 1.8.6p3

tried to setup notification mail for sudo, added this entry in bottom of sudo file using command visudo, But getting syntax error

Code:
Defaults	mailto "babin@xxxxxxxxx.com"
Defaults	mailfrom "root@media.xxxxxxxxxxx.com
Defaults	mail_always on
Defaults	mailsub “*** Command run via sudo on %h ***”
Defaults	mail_badpass on
Defaults	badpass_message "Please Provide Correct Password"
Defaults	!lecture,tty_tickets,!fqdn,!syslog
Defaults	logfile=/var/log/sudo.log

This what the error im keep on getting while saving the sudo


Code:
 121 Defaults        mailto "babin@xxxxxxxxx.com"
    122 Defaults        mailfrom "root@media.xxxxxxxxxxx.com
    123 Defaults        mail_always on
    124 Defaults        mailsub “*** Command run via sudo on %h ***”
    125 Defaults        mail_badpass on
    126 Defaults        badpass_message "Please Provide Correct Password"
    127 Defaults        !lecture,tty_tickets,!fqdn,!syslog
    128 Defaults        logfile=/var/log/sudo.log


Error:

Code:
visudo: >>> /etc/sudoers: syntax error near line 121 <<<
visudo: >>> /etc/sudoers: syntax error near line 121 <<<
What now?

Please guide me how to setup the mail notification for Sudo version 1.8.6p3
 

9 More Discussions You Might Find Interesting

1. Solaris

Solaris E-Mail Notifications ?!

Hi , I need to have a monitoring system also I wanna have E-Mail Notification .or SMS notification to be on touch with my System : ) ... Regards Adel (1 Reply)
Discussion started by: ArabOracle.com
1 Replies

2. UNIX for Dummies Questions & Answers

multiplication shows syntax error

my shell script is simple arithmetic process.my addtion,substract and divide all can be worked only except multiplication.please help me.the shell is following: #!/usr/bin/sh echo "enter a number1:" read number1 echo "enter an operator:" read operator echo "enter a number2:" read number2... (4 Replies)
Discussion started by: sonicstage
4 Replies

3. Solaris

SFTP is successful but still shows timeout error

Hi, I am doing sftp from remote server1 to remote server2. This is done through a script. This script was working fine. But if i am tranfer files of 120 MB only some part of the file gets transferred (around 9 MB). Incase i put the same file manually it gets uploaded successfully. Can... (1 Reply)
Discussion started by: subiksha
1 Replies

4. Shell Programming and Scripting

file system status mail notifications

HI I want to get an e-mail @ my yahoo address when the file system used space gets more than 89% , & the message contents must be the outputs of df -g errpt netstat -i ??????? (3 Replies)
Discussion started by: majd_ece
3 Replies

5. Solaris

Unauthorized sudo access mail

We want to get a notification for all unauthorized sudo access via e-mail to our team DL .. whats the way to do it ? (1 Reply)
Discussion started by: fugitive
1 Replies

6. Shell Programming and Scripting

Sending an email with mail function shows up as an attachment 'noname'

I have a file named email.html with this as the contents: Content-type: text/html ACHI,ACCRETIVE HEALTH ,7.15,<br>CPRT,Copart Inc.,36.14,<br>GEOB.MX,GEO-B,1.660,<br>GCO,Genesco Inc. Comm,73.58,<br>GMAN,Gordmans Stores, ,<br>GES,Guess? Inc. Comm,26.45,<br>KBR,KBR Inc. Common... (1 Reply)
Discussion started by: phpchick
1 Replies

7. Solaris

SUDO error in Solaris: auth.error] fork

I cannot solve the following error bellow. Can someone help me on this please? Mar 31 07:08:45 serverx sudo: fork Mar 31 07:18:50 serverx sudo: fork Mar 31 07:28:45 serverx sudo: fork Mar 31 07:38:47 serverx sudo: fork Mar 31 07:48:45 serverx sudo: fork Mar 31 07:58:45 serverx... (1 Reply)
Discussion started by: pangarano
1 Replies

8. UNIX for Advanced & Expert Users

Sudo syntax

Anyone know of a way shorten a Cmnd_Alias when multiple similar commands are used? For example, I need to grant access to /usr/bin/systemctl start <service>, /usr/bin/systemctl stop <service>, /usr/bin/systemctl restart <service>, and /usr/bin/systemctl status <service>. I think there is a way to... (1 Reply)
Discussion started by: ducet8
1 Replies

9. Shell Programming and Scripting

Email Notifications on Cron Bash Error Only cp mv rsync

Wondering if anyone can point me to an example of how to setup a bash script that executes cp mv and rsync commands and only sends an email if there were errors with any of those commands and what the errors are. In addition it should email if the cron event to execute the script fails, or in... (1 Reply)
Discussion started by: consultant
1 Replies
yum-updatesd.conf(5)					  yum-updatesd configuration file				      yum-updatesd.conf(5)

NAME
yum-updatesd.conf - Configuration file for yum-updatesd(8). DESCRIPTION
yum-updatesd uses a configuration file at /etc/yum/yum-updatesd.conf. Additional configuration information is read from the main yum.conf (5) configuration file. PARAMETERS
There is one section in the yum-updatesd configuration file, main, which defines all of the global configuration options. [main] OPTIONS The [main] section must exist for yum-updatesd to do anything. It consists of the following options: run_interval Number of seconds to wait between checks for available updates. updaterefresh Minimum number of seconds between update information refreshes to avoid hitting the server too often. emit_via List of ways to emit update notification. Valid values are `email', `dbus' and `syslog'. do_update Boolean option to decide whether or not updates should be automatically applied. Defaults to False. do_download_deps Boolean option to decide whether or not updates should be automatically downloaded. Defaults to False. do_download_deps Boolean option to automatically download dependencies of packages which need updating as well. Defaults to False. MAIL OPTIONS
email_to List of email addresses to send update notification to. Defaults to `root@localhost'. email_from Email address for update notifications to be from. Defaults to `yum-updatesd@localhost'. SYSLOG OPTIONS
syslog_facility What syslog facility should be used. Defaults to `DAEMON'. syslog_level Level of syslog messages. Defaults to `WARN'. FILES
/etc/yum/yum-updatesd.conf SEE ALSO
yum-updatesd(8) yum.conf(5) Jeremy Katz yum-updatesd.conf(5)
All times are GMT -4. The time now is 09:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy