summaryrefslogtreecommitdiffstats
path: root/abs/core
diff options
context:
space:
mode:
authorBritney Fransen <brfransen@gmail.com>2013-11-27 23:11:51 (GMT)
committerBritney Fransen <brfransen@gmail.com>2013-11-27 23:11:51 (GMT)
commit53cdae83dcdff66811e5a336fda909642b04d4a2 (patch)
treeeee6be38cc03f5c12178e993ff5bc80ba317beb2 /abs/core
parent5f089a293712100ad1b1ef07248a65baa7449171 (diff)
parent13329fa498c6a12fd1bcd81ec6168a443a705f8d (diff)
downloadlinhes_pkgbuild-53cdae83dcdff66811e5a336fda909642b04d4a2.zip
linhes_pkgbuild-53cdae83dcdff66811e5a336fda909642b04d4a2.tar.gz
linhes_pkgbuild-53cdae83dcdff66811e5a336fda909642b04d4a2.tar.bz2
Merge branch 'testing' of linhes.org:linhes_pkgbuild into testing
Diffstat (limited to 'abs/core')
-rwxr-xr-xabs/core/LinHES-system/PKGBUILD14
-rw-r--r--abs/core/LinHES-system/msg.cfg (renamed from abs/core/func/msg.cfg)0
-rw-r--r--abs/core/LinHES-system/myth_status.py302
-rw-r--r--abs/core/func/PKGBUILD34
-rw-r--r--abs/core/supplemental-web/PKGBUILD2
-rw-r--r--abs/core/supplemental-web/contents/header.html4
-rwxr-xr-xabs/core/xymon/PKGBUILD13
-rwxr-xr-xabs/core/xymon/alerts.cfg8
-rw-r--r--abs/core/xymon/login_notify.sh64
9 files changed, 327 insertions, 114 deletions
diff --git a/abs/core/LinHES-system/PKGBUILD b/abs/core/LinHES-system/PKGBUILD
index f7e3a55..0a0d5f1 100755
--- a/abs/core/LinHES-system/PKGBUILD
+++ b/abs/core/LinHES-system/PKGBUILD
@@ -1,6 +1,6 @@
pkgname=LinHES-system
pkgver=8.1
-pkgrel=3
+pkgrel=4
arch=('i686' 'x86_64')
install=system.install
pkgdesc="Everything that makes LinHES an automated system"
@@ -30,7 +30,7 @@ binfiles="LinHES-start optimize_mythdb.py myth_mtc.py myth_mtc.sh
source=(LinHES-session LinHES-profile.sh $binfiles
alsa-base diskspace.cron cacheclean.cron xfs_defrag.cron
readme_is_xml readme_light add_storage.readme
- system-sudo.rules )
+ system-sudo.rules msg.cfg)
package() {
cd $srcdir
@@ -70,6 +70,9 @@ package() {
chown -R root:root $pkgdir/etc/sudoers.d
install -o root -g root -m 0750 $srcdir/system-sudo.rules $pkgdir/etc/sudoers.d/system_sudo
+ #config file of msg_daemon
+ install -m755 -D $srcdir/msg.cfg $pkgdir/usr/MythVantage/etc/msg.cfg
+
}
md5sums=('95720bd676d0b05e89e1f6ae6e0b4e2d'
@@ -83,7 +86,7 @@ md5sums=('95720bd676d0b05e89e1f6ae6e0b4e2d'
'542e670e78d117657f93141e9689f54d'
'8da6a7f1703a002f84e66629e847d8a6'
'bb72ab230c7a71706285bd0f31a4fb1f'
- 'a8c79014423a95b41908fbe74ba83a6e'
+ '07fc64580cc98aa28561730ac7695eca'
'962a3e9eaba2d1466251b7ab0956705d'
'1758aed160de64abfafb28a3a8f3390e'
'33fbebbd546672cedd3c5e7350ab414e'
@@ -117,7 +120,7 @@ md5sums=('95720bd676d0b05e89e1f6ae6e0b4e2d'
'34fc1f58ad1eabf4eff4979d420760c0'
'c3ada01d3a739abe3f920b02d4ea3f6e'
'a94fe6d980f4b810f2e2ae5352084b39'
- '1c71ff372978159f09342b18954500b3'
+ 'f808e8614246913a7f633b51c7169c85'
'3fc3d584fadd47f82c5cfe8ac0f4322a'
'503df99218373dfc75e7e7f5e449a44e'
'4a1fda884dcd7d65fb2690fbdbd92a83'
@@ -132,4 +135,5 @@ md5sums=('95720bd676d0b05e89e1f6ae6e0b4e2d'
'36bdfa8d877cea20ca3870faf08e08d5'
'59d0602bac7e06f11abba1894acc8bb0'
'da432d68962e109e09beb2b71c8c8571'
- '366ccb097d1c221389709485c3b2d159')
+ '366ccb097d1c221389709485c3b2d159'
+ 'bdd37627c9effd745a051fd2d279975b')
diff --git a/abs/core/func/msg.cfg b/abs/core/LinHES-system/msg.cfg
index 0d687c5..0d687c5 100644
--- a/abs/core/func/msg.cfg
+++ b/abs/core/LinHES-system/msg.cfg
diff --git a/abs/core/LinHES-system/myth_status.py b/abs/core/LinHES-system/myth_status.py
index f0e41f3..0f2edfb 100644
--- a/abs/core/LinHES-system/myth_status.py
+++ b/abs/core/LinHES-system/myth_status.py
@@ -1,21 +1,12 @@
#!/usr/bin/python2
+#This program is called on login to display the status of mythtv tuners & recording status
+#Also will display alerts generated by xymon. If the location of xymon changes, this script needs to be updated.
+
from MythTV import MythBE,MythDB,MythLog
import datetime,time,sys,subprocess,re
-try:
- be = MythBE()
- db = MythDB()
-except:
- print "\nCouldn't connect to MythTV service for status"
- sys.exit(1)
-
-cursor = db.cursor()
-now = datetime.datetime.now()
-farout=99999999
-next_start_diff=datetime.timedelta(farout)
-num_upcoming=12
+import os,glob
def formatTD(td):
- #print td
days = td.days
hours = td.seconds // 3600
minutes = (td.seconds % 3600) // 60
@@ -46,76 +37,223 @@ def formatTD(td):
return_string = '%s%s%s%s' % (day_string, hour_string, minute_string, second_string)
return return_string
+def print_alerts():
+ dir_name = "/home/xymon/var/login_alerts"
+ out_alert=""
+ try:
+ os.chdir(dir_name)
+ except:
+ pass
+ #print " myth_status: Couldn't change dir to %s" %dir_name
+ file_list=glob.glob("*")
+
+ if len(file_list) == 0:
+ #print " myth_status: no alert files found"
+ pass
+ else:
+ for alert_file in file_list:
+ out_line=''
+ datahost = ''
+ dataservice = ''
+ datadown = ''
+ try:
+ #print " myth_staus: reading in %s" %alert_file
+ f=open(alert_file,'r')
+ lines=f.readlines()
+ f.close()
+ except:
+ #print " myth_status: Couldn't open %s for reading" %alert_file
+ continue
+
+ for line in lines:
+ try:
+ data,value=line.split(":")
+ except:
+ continue #exception occured try the next line
+
+ if data == 'HOST':
+ datahost = value.strip()
+ elif data == 'SERVICE':
+ dataservice = value.strip()
+ elif data == 'DOWN':
+ datadown = value.strip()
+ sec=int(datadown)
+ td_sec = datetime.timedelta(seconds=sec)
+ td_sec_formated = formatTD(td_sec)
+
+ out_line =" %s on %s down for %s \n" %(dataservice,
+ datahost,
+ td_sec_formated)
+ out_alert += out_line
+
+ print "System Alerts:"
+ print "---------------"
+ if len(out_alert) > 0:
+ print out_alert
+ print " Please see the system health webpage for more information"
+ else:
+ print " All systems OK"
-a=be.getRecorderList()
-header="#"*60
-print header
-print ""
-print "Tuner Status:"
-print "-------------"
-for i in a:
- cmd="select cardtype,hostname from capturecard where cardid=%s;" %i
+ return
- cursor.execute(cmd)
- results=cursor.fetchall()
- type = results[0][0]
- hostname = results[0][1]
- id = i
- try:
- c=be.getCurrentRecording(i)
- if c.title == None:
- current_recording = "Idle"
+
+#-------------------------------------------
+
+
+class tuner_recording_status:
+ def __init__ (self,num_upcoming):
+
+ self.now = datetime.datetime.now()
+ self.farout=99999999
+ self.next_start_diff=datetime.timedelta(self.farout)
+ self.num_upcoming=num_upcoming
+ self.tuner_status_list=[]
+ self.conflict_list=[]
+ self.upcoming_list=[]
+ self.ur=0
+ self.db_connection_status = self.check_database_connection()
+ if self.db_connection_status == 0:
+ self.tuner_status()
+ self.conflicts()
+ self.upcoming_recordings()
+
+ def get_db_check_status(self):
+ return self.db_connection_status
+
+ def check_database_connection(self):
+ rc=0
+ try:
+ self.be = MythBE()
+ self.db = MythDB()
+ self.cursor = self.db.cursor()
+ except:
+ print "\nCouldn't connect to MythTV service for status"
+ rc=1
+ return rc
+#-----
+ def tuner_status(self):
+ a=self.be.getRecorderList()
+ for i in a:
+ outline=''
+ cmd="select cardtype,hostname from capturecard where cardid=%s;" %i
+ self.cursor.execute(cmd)
+ results=self.cursor.fetchall()
+ type = results[0][0]
+ hostname = results[0][1]
+ id = i
+ try:
+ c=self.be.getCurrentRecording(i)
+ if c.title == None:
+ current_recording = "Idle"
+ else:
+ current_recording = "Recording %s" %c.title
+ outline = " Tuner %s (%s) on %s : %s " %(id, type, hostname, current_recording)
+ self.tuner_status_list.append(outline)
+ except:
+ outline = " Tuner %s (%s) on %s : %s " %(id, type, hostname, "Tuner Error")
+ self.tuner_status_list.append(outline)
+
+ def get_tuner_status(self):
+ return self.tuner_status
+
+ def print_tuner_status(self):
+ print "Tuner Status:"
+ print "-------------"
+ if len(self.tuner_status_list) > 0 :
+ for line in self.tuner_status_list:
+ print line
else:
- current_recording = "Recording %s" %c.title
- print " Tuner %s (%s) on %s : %s " %(id, type, hostname, current_recording)
- except:
- print " Tuner %s (%s) on %s : %s " %(id, type, hostname, "Tuner Error")
-
-print ""
-print "Upcoming Recordings (Next %s Scheduled):" %(num_upcoming)
-print "----------------------------------------"
-a=be.getUpcomingRecordings()
-r=0
-for i in a:
- r += 1
- if r > num_upcoming:
- break
-
- title_chan="%s (%s)" %(i.title, i.channame)
- #remove timezone
- start_time=re.split("[-+]\d\d:\d\d",str(i.starttime))[0]
- start_time_struct=datetime.datetime.strptime(start_time, "%Y-%m-%d %H:%M:%S")
- start_time_out=start_time_struct.strftime("%a %b %d %I:%M%p")
- print " %s - %s - %s" %(start_time_out,i.hostname, title_chan)
- diff = start_time_struct - now
- if diff < next_start_diff :
- next_start_diff = diff
-
-
-print ""
-print "Recording Conflicts:"
-print "----------------------"
-a=be.getConflictedRecordings()
-c=0
-for i in a:
- title_chan="%s (%s)" %(i.title, i.channame)
- print " %s - %-50s " %(i.starttime,title_chan)
- c=c+1
-
-if c == 0:
- print " No Conflicts"
-
-print ""
-
-if next_start_diff == datetime.timedelta(farout):
- ur="No recordings are scheduled"
-else:
- ur=formatTD(next_start_diff)
-print "The next recording starts in:"
-print "-----------------------------"
-print " %s" %(ur)
-print ""
-subprocess.call("/usr/LH/bin/diskspace.sh",shell=True)
-print ""
-print header
+ print " No tuners found"
+
+#--------
+ def upcoming_recordings(self):
+
+ a=self.be.getUpcomingRecordings()
+ r=0
+ for i in a:
+ r += 1
+ if r > self.num_upcoming:
+ break
+
+ title_chan="%s (%s)" %(i.title, i.channame)
+ #remove timezone
+ start_time=re.split("[-+]\d\d:\d\d",str(i.starttime))[0]
+ start_time_struct=datetime.datetime.strptime(start_time, "%Y-%m-%d %H:%M:%S")
+ start_time_out=start_time_struct.strftime("%a %b %d %I:%M%p")
+ self.upcoming_list.append([start_time_out,i.hostname, title_chan])
+ #print " %s - %s - %s" %(start_time_out,i.hostname, title_chan)
+ diff = start_time_struct - self.now
+ if diff < self.next_start_diff :
+ self.next_start_diff = diff
+
+ if self.next_start_diff == datetime.timedelta(self.farout):
+ self.ur="No recordings are scheduled"
+ else:
+ self.ur=formatTD(self.next_start_diff)
+
+
+ def get_upcoming_recordings(self):
+ return self.upcoming_list
+
+ def print_upcoming_recordings(self):
+ #print self.get_upcoming_recordings()
+ print ""
+ print "Upcoming Recordings (Next %s Scheduled):" %(self.num_upcoming)
+ print "----------------------------------------"
+ if len(self.get_upcoming_recordings()) > 0:
+ for i in self.get_upcoming_recordings():
+ #print " %s - %s - %s" %(start_time_out,i.hostname, title_chan)
+ print " %s - %s - %s" %(i[0],i[1],i[2])
+ else:
+ print " No upcoming recordings"
+ pass
+
+ def get_next_start_time(self):
+ return self.ur
+
+ def print_next_start_time(self):
+ print ""
+ print "The next recording starts in:"
+ print "-----------------------------"
+ print " %s" %(self.get_next_start_time())
+ print ""
+
+#-----
+
+ def conflicts(self):
+ a=self.be.getConflictedRecordings()
+ for i in a:
+ out_line=''
+ title_chan="%s (%s)" %(i.title, i.channame)
+ out_line=(i.starttime,title_chan)
+ self.conflict_list.append(out_line)
+
+ def get_conflict_list(self):
+ return self.conflict_list
+
+ def print_conflict_list(self):
+ print ""
+ print "Recording Conflicts:"
+ print "----------------------"
+ if len(self.get_conflict_list()) > 0:
+ for i in self.get_conflict_list():
+ print " %s - %-50s " %(i[0],i[1])
+ else:
+ print " No conflicts"
+
+#header="#"*60
+
+
+def go():
+ tuner = tuner_recording_status(12)
+ if tuner.get_db_check_status() == 0:
+ tuner.print_tuner_status()
+ tuner.print_upcoming_recordings()
+ tuner.print_conflict_list()
+ tuner.print_next_start_time()
+ print_alerts()
+
+
+if __name__ == "__main__":
+ go()
diff --git a/abs/core/func/PKGBUILD b/abs/core/func/PKGBUILD
index a4844cb..1b7b000 100644
--- a/abs/core/func/PKGBUILD
+++ b/abs/core/func/PKGBUILD
@@ -1,6 +1,6 @@
pkgname=func
pkgver=0.25
-pkgrel=16
+pkgrel=17
pkgdesc="fedora unifed network controller"
url=""
license="gpl"
@@ -10,27 +10,26 @@ conflicts=()
replaces=()
backup=('etc/func/minion.conf')
install=func.install
-source=($pkgname-$pkgver.tar.gz minion.conf power.py pacman.py failed_func fe_restart.py msg.py msg.cfg func_ssl_patch logrotate-func.conf)
+source=($pkgname-$pkgver.tar.gz minion.conf power.py pacman.py failed_func fe_restart.py msg.py func_ssl_patch logrotate-func.conf)
arch=('i686' 'x86_64')
package() {
moddir="$pkgdir/usr/lib/python2.7/site-packages/func/minion/modules/"
- cd $srcdir/$pkgname-${pkgver}
+ cd $srcdir/$pkgname-${pkgver}
patch -Np1 < $srcdir/func_ssl_patch
- python2 setup.py build
- python2 setup.py install --prefix=$pkgdir/usr
- cd $srcdir
- install -m755 -D minion.conf $pkgdir/etc/func/minion.conf
- install -m755 -D $srcdir/$pkgname-$pkgver/etc/async_methods.conf $pkgdir/etc/func/async_methods.conf
- install -m755 -D $srcdir/$pkgname-${pkgver}/etc/sample.acl $pkgdir/etc/func/minion-acl.d/sample.acl
- install -m755 -D $srcdir/$pkgname-${pkgver}/etc/Test.conf $pkgdir/etc/func/modules/Test.conf
- install -m755 -D $srcdir/power.py ${moddir}/power.py
- install -m755 -D $srcdir/pacman.py ${moddir}/pacman.py
- install -m755 -D $srcdir/msg.py ${moddir}/msg.py
- install -m755 -D $srcdir/msg.cfg $pkgdir/usr/MythVantage/etc/msg.cfg
- install -m755 -D $srcdir/fe_restart.py ${moddir}/fe_restart.py
- install -m755 -D $srcdir/failed_func $pkgdir/usr/MythVantage/bin/failed_func
- mkdir -p $pkgdir/var/log/func
+ python2 setup.py build
+ python2 setup.py install --prefix=$pkgdir/usr
+ cd $srcdir
+ install -m755 -D minion.conf $pkgdir/etc/func/minion.conf
+ install -m755 -D $srcdir/$pkgname-$pkgver/etc/async_methods.conf $pkgdir/etc/func/async_methods.conf
+ install -m755 -D $srcdir/$pkgname-${pkgver}/etc/sample.acl $pkgdir/etc/func/minion-acl.d/sample.acl
+ install -m755 -D $srcdir/$pkgname-${pkgver}/etc/Test.conf $pkgdir/etc/func/modules/Test.conf
+ install -m755 -D $srcdir/power.py ${moddir}/power.py
+ install -m755 -D $srcdir/pacman.py ${moddir}/pacman.py
+ install -m755 -D $srcdir/msg.py ${moddir}/msg.py
+ install -m755 -D $srcdir/fe_restart.py ${moddir}/fe_restart.py
+ install -m755 -D $srcdir/failed_func $pkgdir/usr/MythVantage/bin/failed_func
+ mkdir -p $pkgdir/var/log/func
install -m644 -D ../logrotate-func.conf $pkgdir/etc/logrotate.d/func
cd $pkgdir
@@ -44,6 +43,5 @@ md5sums=('892252004f122c61bb58bb4607553ffe'
'c30f420c01628a08061270e8502115c5'
'b02a733b7a74569e57521bc3708724a5'
'7b4266a8031cf7de485bf6b74e57bd74'
- 'bdd37627c9effd745a051fd2d279975b'
'b816bdb222e646a7801b218c3a626b0e'
'7d7c8a334f6b46ae1e5e483854b93924')
diff --git a/abs/core/supplemental-web/PKGBUILD b/abs/core/supplemental-web/PKGBUILD
index 5448bcc..90d2370 100644
--- a/abs/core/supplemental-web/PKGBUILD
+++ b/abs/core/supplemental-web/PKGBUILD
@@ -1,7 +1,7 @@
pkgbase=supplemental-web
pkgname=('supplemental-web' 'supplemental-web-slave')
pkgver=8.0
-pkgrel=12
+pkgrel=13
arch=('i686' 'x86_64')
license=('GPL')
backup=('data/srv/httpd/cgi/extra.cfg.txt')
diff --git a/abs/core/supplemental-web/contents/header.html b/abs/core/supplemental-web/contents/header.html
index d972bfa..5f4bb14 100644
--- a/abs/core/supplemental-web/contents/header.html
+++ b/abs/core/supplemental-web/contents/header.html
@@ -43,9 +43,11 @@ function beStatus()
<li><a id="modify-me">MythBackend Status</a></li>
+<li><a href="xymon/">Health & Maintenance</a></li>
+
<li><a href="xymon" >System &#187;</a>
<ul>
- <li><a href="/xymon" >Health</a></li>
+ <!-- <li><a href="/xymon" >Health</a></li>-->
<li><a href="/logs/" >Logs</a></li>
<li><a href="/exports.shtml" >File Shares</a></li>
<li><a href="/cardmap.shtml" >Tuners</a></li>
diff --git a/abs/core/xymon/PKGBUILD b/abs/core/xymon/PKGBUILD
index a0c603b..96aa82f 100755
--- a/abs/core/xymon/PKGBUILD
+++ b/abs/core/xymon/PKGBUILD
@@ -1,14 +1,14 @@
pkgbase=xymon
pkgname=(xymonserver xymonclient)
pkgver=4.3.5
-pkgrel=50
+pkgrel=51
pkgdesc="Hobbit is a system for monitoring servers and networks. "
license="GPL"
arch=('i686' 'x86_64')
url="http://www.xymon.com/"
-source=(http://hivelocity.dl.sourceforge.net/project/xymon/Xymon/4.3.5/xymon-4.3.5.tar.gz hobbitadd.py xymon_ghost_check graph.cfg.diff xymonserver.cfg.diff tasks.d.mv clientlaunch.cfg.patch hobbitstorage.py hbnotes.py hobbit-myth-orphan.sh analysis.cfg hbfunc.py be.png tuner.png tv.png hobbit-mem-myth.sh hobbit_notify.sh alerts.cfg hobbit_myth_data.py logrotate-server.xymon logrotate-client.xymon log_list.sh client-local.cfg.patch led_themes.tar.gz xymon-server.rules hosts.cfg.patch)
+source=(http://hivelocity.dl.sourceforge.net/project/xymon/Xymon/4.3.5/xymon-4.3.5.tar.gz hobbitadd.py xymon_ghost_check graph.cfg.diff xymonserver.cfg.diff tasks.d.mv clientlaunch.cfg.patch hobbitstorage.py hbnotes.py hobbit-myth-orphan.sh analysis.cfg hbfunc.py be.png tuner.png tv.png hobbit-mem-myth.sh hobbit_notify.sh login_notify.sh alerts.cfg hobbit_myth_data.py logrotate-server.xymon logrotate-client.xymon log_list.sh client-local.cfg.patch led_themes.tar.gz xymon-server.rules hosts.cfg.patch)
depends=('rrdtool' 'fping' 'pcre' 'python2' 'graphviz' 'LinHES-system>=8.0-5')
@@ -67,6 +67,7 @@ package_xymonserver(){
cat alerts.cfg >> $startdir/pkg/xymonserver/home/xymon/etc/alerts.cfg
install -m755 hobbit_notify.sh $startdir/pkg/xymonserver/home/xymon/server/bin/hobbit_notify.sh
+ install -m755 login_notify.sh $startdir/pkg/xymonserver/home/xymon/server/bin/login_notify.sh
install -m755 $startdir/src/tv.png $startdir/pkg/xymonserver/data/srv/httpd/htdocs/xymon/gifs/tv.png
install -m755 $startdir/src/tuner.png $startdir/pkg/xymonserver/data/srv/httpd/htdocs/xymon/gifs/tuner.png
install -m755 $startdir/src/be.png $startdir/pkg/xymonserver/data/srv/httpd/htdocs/xymon/gifs/be.png
@@ -91,6 +92,9 @@ package_xymonserver(){
patch -p3 < $startdir/src/client-local.cfg.patch || return 1
patch -p3 < $startdir/src/hosts.cfg.patch || return 1
+ #make dir for login alerts
+ mkdir $startdir/pkg/xymonserver/home/xymon/var/login_alerts
+
#fix permissions
chmod 775 $startdir/pkg/xymonserver/data/srv/httpd/htdocs/
chmod 775 $startdir/pkg/xymonserver/data/srv/httpd/htdocs/xymon/
@@ -99,6 +103,8 @@ package_xymonserver(){
chmod 775 $startdir/pkg/xymonserver/data/srv/httpd/htdocs/xymon/snap/
chmod 775 $startdir/pkg/xymonserver/data/srv/httpd/htdocs/xymon/rep/
chmod 750 $startdir/pkg/xymonserver/etc/sudoers.d
+ chmod 775 $startdir/pkg/xymonserver/home/xymon/var/login_alerts
+
}
@@ -137,7 +143,8 @@ md5sums=('31923ec126fe1c264fceb459d2175161'
'0469d775db9fdd18ea95dd41937ada82'
'0757294eec13771f8e63da23cf066796'
'6baa410da1dfb86435191f4805186ea7'
- '81715c58ae495812da0e0f18e2f74c76'
+ 'a834dd134b6d640d753b1e26609d37df'
+ '9b5f3079c461f1e0a1b5fb805d073665'
'77a542c2fd13468791ef23057ba8e77d'
'b4e8641e97e6b689dbc634af785e6799'
'e2844513e2c92e8b5084818f3b2a478d'
diff --git a/abs/core/xymon/alerts.cfg b/abs/core/xymon/alerts.cfg
index 4f97f18..3ba26bd 100755
--- a/abs/core/xymon/alerts.cfg
+++ b/abs/core/xymon/alerts.cfg
@@ -119,10 +119,10 @@
HOST=* SERVICE=func
- SCRIPT /home/xymon/server/bin/hobbit_notify.sh 1234567890 FORMAT=SMS DURATION=4h REPEAT=48h COLOR=red
+ SCRIPT /home/xymon/server/bin/hobbit_notify.sh dummy_notice FORMAT=plain DURATION>4h REPEAT=48h COLOR=red
HOST=* SERVICE=* EXSERVICE=conn
- SCRIPT /home/xymon/server/bin/hobbit_notify.sh 1234567890 FORMAT=SMS DURATION=4h REPEAT=12h COLOR=red
-# SCRIPT /home/xymon/server/bin/hobbit_notify.sh 1234567890 FORMAT=SMS DURATION=4H REPEAT=12H COLOR=yellow
-
+ SCRIPT /home/xymon/server/bin/hobbit_notify.sh dummy_notice FORMAT=plain DURATION>4h REPEAT=12h COLOR=red
+ SCRIPT /home/xymon/server/bin/login_notify.sh dummy_notice FORMAT=plain DURATION>5m REPEAT=5m COLOR=red RECOVERED
+
diff --git a/abs/core/xymon/login_notify.sh b/abs/core/xymon/login_notify.sh
new file mode 100644
index 0000000..6696165
--- /dev/null
+++ b/abs/core/xymon/login_notify.sh
@@ -0,0 +1,64 @@
+#!/bin/bash
+. /etc/systemconfig
+#
+# BBCOLORLEVEL - The color of the alert: "red", "yellow" or "purple"
+# BBALPHAMSG - The full text of the status log triggering the alert
+# ACKCODE - The "cookie" that can be used to acknowledge the alert
+# RCPT - The recipient, from the SCRIPT entry
+# BBHOSTNAME - The name of the host that the alert is about
+# MACHIP - The IP-address of the host that has a problem
+# BBSVCNAME - The name of the service that the alert is about
+# BBSVCNUM - The numeric code for the service. From SVCCODES definition.
+# BBHOSTSVC - HOSTNAME.SERVICE that the alert is about.
+# BBHOSTSVCCOMMAS - As BBHOSTSVC, but dots in the hostname replaced with commas
+# BBNUMERIC - A 22-digit number made by BBSVCNUM, MACHIP and ACKCODE.
+# RECOVERED - Is "1" if the service has recovered.
+# DOWNSECS - Number of seconds the service has been down.
+# DOWNSECSMSG - When recovered, holds the text "Event duration : N" where
+
+# LOGIN_OUT=/tmp/login_out
+# echo $BBCOLORLEVEL >> $LOGIN_OUT
+# echo $BBALPHAMSG >>$LOGIN_OUT
+# echo $RCPT >>$LOGIN_OUT
+# echo $BBHOSTNAME >>$LOGIN_OUT
+# echo $BBSVCNAME >>$LOGIN_OUT
+# echo $BBHOSTSVC >>$LOGIN_OUT
+# echo $BBHOME >> $LOGIN_OUT
+# echo $DOWNSECS >> $LOGIN_OUT
+# echo $RECOVERED >> $LOGIN_OUT
+# echo "----------" >> $LOGIN_OUT
+
+#BBCOLORLEVEL=red
+#BBCOLORLEVEL=yellow
+#BBALPHAMSG="vmtest:disk red [751147]"
+#BBHOSTNAME="testcraa"
+#BBSVCNAME="disk"
+#BBSVCNAME="func"
+#BBHOSTSVC="vmtest.disk"
+
+#bbhome ends up as /home/xymon/server which is why I didn't use it here
+NOTICE_DIR="/home/xymon/var/login_alerts"
+if [ ! -d $NOTICE_DIR ]
+then
+ mkdir $NOTICE_DIR
+fi
+
+if [ "x$RECOVERED" == "x1" ]
+then
+ if [ -f $NOTICE_DIR/$BBHOSTSVC ]
+ then
+ rm -f $NOTICE_DIR/$BBHOSTSVC
+ else
+ echo "$NOTICE_DIR/$BBHOSTSVC is not present, didn't remove it"
+ fi
+else
+ echo "DOWN: $DOWNSECS" > $NOTICE_DIR/$BBHOSTSVC
+ echo "SERVICE: $BBSVCNAME" >> $NOTICE_DIR/$BBHOSTSVC
+ echo "HOST: $BBHOSTNAME" >> $NOTICE_DIR/$BBHOSTSVC
+ echo "ACKCODE: $ACKCODE" >> $NOTICE_DIR/$BBHOSTSVC
+ echo "MSG $BBALPHAMSG" >> $NOTICE_DIR/$BBHOSTSVC
+
+fi
+
+
+