<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Andrew,<br>
<br>
Rhetorical Q: What is the exit status of script.py, and are you
handling it appropriately?<br>
<br>
Suggestion: qualify or expand paths in all cases. Don't rely on
your environment to know what you really want it to do.<br>
<br>
to = "| /usr/sbin/sudo /home/myID/scripts/script.py"<br>
<br>
Regards,<br>
Tim Peiffer<br>
<pre class="moz-signature" cols="72">--
Tim Peiffer
Network Support Engineer
Office of Information Technology
University of Minnesota/NorthernLights GigaPOP
+1 612 626-7884 (desk)</pre>
<br>
<br>
On 7/26/12 5:56 PM, Andrew Pattison wrote:<br>
</div>
<blockquote
cite="mid:CAM7PLK7h_ws6rO6y5gNkWYDqYCkjK69qSoBVUE7BEpyXPtbW2w@mail.gmail.com"
type="cite">I tried that but it still doesn't work. The alert is
triggered as it is logged in /var/messages but either smokeping is
not calling the script or the call is failing. Any ideas?<br>
<br>
Andrew.<br>
<br>
<div class="gmail_quote">
On 25 July 2012 17:23, Ryan Becker <span dir="ltr"><<a
moz-do-not-send="true" href="mailto:rb14060@gmail.com"
target="_blank">rb14060@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
Try using the absolute path to the script in the sudoers file.
Also, the /etc/sudoers file should NOT be edited directly,
you should be using the visudo command as root.<br>
<br>
<div class="gmail_quote">On Wed, Jul 25, 2012 at 4:41 AM,
Andrew Pattison <span dir="ltr"><<a
moz-do-not-send="true" href="mailto:andrum99@gmail.com"
target="_blank">andrum99@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">I've got
something similar in in /etc/sudoers already.<br>
<br>
Thanks<span><font color="#888888"><br>
<br>
Andrew.</font></span>
<div>
<div><br>
<br>
<div class="gmail_quote">On 24 July 2012 23:15, Ryan
Becker <span dir="ltr"><<a
moz-do-not-send="true"
href="mailto:rb14060@gmail.com" target="_blank">rb14060@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">Make
sure that the user is allowed to execute the
script without a password. Here's an example that
you can modify to suit your needs: techbnc ALL =
NOPASSWD: /usr/sbin/csf
<div>
In this example the user techbnc is allowed to
call /usr/sbin/csf without needing a password.
What's happening is that normally when sudo is
called, it asks for the password and Smokeping
has no way to provide that password. By adding
the user to the file with NOPASSWD, they are
allowed to execute the script without being
password prompted and therefore Smokeping will
be able to complete the action.<br>
<div><br>
<div class="gmail_quote">
<div>
<div>On Tue, Jul 24, 2012 at 5:35 PM,
Andrew Pattison <span dir="ltr"><<a
moz-do-not-send="true"
href="mailto:andrum99@gmail.com"
target="_blank">andrum99@gmail.com</a>></span>
wrote:<br>
</div>
</div>
<blockquote class="gmail_quote"
style="margin:0 0 0 .8ex;border-left:1px
#ccc solid;padding-left:1ex">
<div>
<div>
I am trying to set up smokeping with
an alert script. The alert script is
called like this entry in
/etc/smokeping/config.d/Alerts:<br>
<br>
to = |sudo script.py<br>
<br>
When called as simply |script.py this
works fine, but with sudo the script
does not get called. How can I get
this working?<br>
<br>
Thanks<span><font color="#888888"><br>
<br>
Andrew.<br>
</font></span><br>
</div>
</div>
_______________________________________________<br>
smokeping-users mailing list<br>
<a moz-do-not-send="true"
href="mailto:smokeping-users@lists.oetiker.ch"
target="_blank">smokeping-users@lists.oetiker.ch</a><br>
<a moz-do-not-send="true"
href="https://lists.oetiker.ch/cgi-bin/listinfo/smokeping-users"
target="_blank">https://lists.oetiker.ch/cgi-bin/listinfo/smokeping-users</a><br>
<br>
</blockquote>
</div>
<br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</blockquote>
</div>
<br>
</blockquote>
</div>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
smokeping-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:smokeping-users@lists.oetiker.ch">smokeping-users@lists.oetiker.ch</a>
<a class="moz-txt-link-freetext" href="https://lists.oetiker.ch/cgi-bin/listinfo/smokeping-users">https://lists.oetiker.ch/cgi-bin/listinfo/smokeping-users</a>
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">
</pre>
</body>
</html>