Commit 02293d69 by netz.coop

v0.1.7 Posttools Monitoring

1 parent fc9b01f2
2018-01-17 v0.1.7 Posttools Monitoring
2018-01-16 v0.1.6 Posttools Fix
2018-01-16 v0.1.5 Posttools
2018-01-16 v0.1.4 startscript kill
......
......@@ -41,12 +41,17 @@ class mailcnf_posttools(ncauth_base):
if action == 'postersuper1':
msg = self.postsuperdel(id,mailname)
msglvl="alert-info"
if action == 'postersupersend1':
msg = self.postersupersend1(id,mailname)
msglvl="alert-info"
loader =tornado. template.Loader(os.path.join(os.path.dirname(__file__), "../templates"))
navigation=loader.load("navigation.html").generate(nav=nav)
subnavigation=loader.load("subnav_"+module+"_"+mainfnc+".html").generate(subnav=subnav)
mailstuff=self.mailcheck()
mailstufflist=self.mailchecktuple()
maincontent=loader.load("content_"+module+"_"+mainfnc+".html").generate(mailstuff=mailstuff,mailstufflist=mailstufflist)
number=10
checklogin=self.checklogin(number)
maincontent=loader.load("content_"+module+"_"+mainfnc+".html").generate(mailstuff=mailstuff,mailstufflist=mailstufflist,checklogin=checklogin)
self.render('base.html', navigation=navigation, subnavigation=subnavigation, maincontent=maincontent, msg=msg, msglvl=msglvl)
......@@ -84,9 +89,30 @@ class mailcnf_posttools(ncauth_base):
return dict
def postsuperdel(self,id,mailname=''):
self.write("postsuper -d "+str(id)+" " )
#self.write("postsuper -d "+str(id)+" " )
old_dir = os.getcwd()
os.chdir( os.path.join(os.path.dirname(__file__), "") )
os.chdir( '..')
p1 = str(Popen("/usr/sbin/postsuper -d "+str(id) , stdout=PIPE, shell=True).communicate()[0])
return "Nachricht "+str(id)+" von "+str(mailname)+" gelöscht"
def postersupersend1(self,id,mailname=''):
#self.write("postsuper -d "+str(id)+" " )
old_dir = os.getcwd()
os.chdir( os.path.join(os.path.dirname(__file__), "") )
os.chdir( '..')
p1 = str(Popen("/usr/sbin/postqueue -i "+str(id) , stdout=PIPE, shell=True).communicate()[0])
return "Nachricht "+str(id)+" von "+str(mailname)+" wird erneut versucht zu senden"
def checklogin(self,number):
#self.write("postsuper -d "+str(id)+" " )
old_dir = os.getcwd()
os.chdir( os.path.join(os.path.dirname(__file__), "") )
os.chdir( '..')
p1 = str(Popen("grep sasl_username /var/log/mail.log |awk {'print $NF'}|sort| uniq -c|sort -n| awk '$1 > "+str(number)+" { print $1 \" \" $2 }' " , stdout=PIPE, shell=True).communicate()[0])
thatLine = p1.replace('\\n', '<br>')
thatLine = thatLine.replace('b\'', '<br>')
thatLine = thatLine.replace('\'', '')
return thatLine
\ No newline at end of file
......@@ -225,8 +225,24 @@ margin:6px;
width: 100%;
}
/*input[value="Edit"]{
color:red;
}*/
*/
.mailbutton1,
.mailbutton2
{
width:45%;
margin:5px;
}
.mailbutton1{
float: left;
}
.mailbutton2{
float: right;
}
.mailbuttoncontainer{
height:25px;
}
\ No newline at end of file
......@@ -8,10 +8,12 @@
<br>
<br>
<div class="alert-info" style="alert">Aktionen postsuper -d $ID </div>
<div class="alert-info" style="alert">Aktionen postsuper -d $ID / postqueue -i $ID</div>
<br>
{% for entry in mailstufflist %}
<div>
<div class="mailbuttoncontainer">
<div class="mailbutton1">
<form action="/mailcnf/posttools" method="POST">
<input type="hidden" size="70" name="fnc" value="mailcnf">
<input type="hidden" value="posttools" size="70" name="mainfnc" class="'">
......@@ -19,13 +21,32 @@
<input type="hidden" value="postersuper1" size="70" name="action" class="'">
<input type="hidden" value="{% raw entry[0] %}" size="70" name="id" class="'">
<input type="hidden" value="{% raw entry[1] %}" size="70" name="mailname" class="'">
<button type="submit" class="btn btn-info btn-block btn-xs">Lösche {% raw entry[0] %} {% raw entry[1] %}</button>
<button type="submit" class="btn btn-danger btn-block btn-xs">Lösche {% raw entry[0] %} {% raw entry[1] %}</button>
</form>
</div><div class="mailbutton2">
<form action="/mailcnf/posttools" method="POST">
<input type="hidden" size="70" name="fnc" value="mailcnf">
<input type="hidden" value="posttools" size="70" name="mainfnc" class="'">
<input type="hidden" value="about" size="70" name="module" class="'">
<input type="hidden" value="postersupersend1" size="70" name="action" class="'">
<input type="hidden" value="{% raw entry[0] %}" size="70" name="id" class="'">
<input type="hidden" value="{% raw entry[1] %}" size="70" name="mailname" class="'">
<button type="submit" class="btn btn-info btn-block btn-xs">Versuche zu senden {% raw entry[0] %} {% raw entry[1] %}</button>
</form>
</div>
</div>
<br>
{% end %}
{% end %}
<br><br>
<br><br>
<div class="alert-info" style="alert">häufigste Anmeldungen</div>
<br>
<div>
{% raw checklogin %}
</div>
<br><br>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!