Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • devel
  • hruska-feature-#6799-filter-keys
  • hruska-feature-5066-duplicateIdeaID
  • hruska-feature-clients-api
  • malostik-#5066-deduplicate-idea-ids
  • master
  • warden-postgresql-port
  • warden-client-1.1.0
  • warden-client-1.2.0
  • warden-client-2.0
  • warden-client-2.0.0-beta1
  • warden-client-2.0.0-beta2
  • warden-client-2.1
  • warden-client-2.1-beta
  • warden-client-2.2
  • warden-client-2.2-final
  • warden-client-3.0-beta0
  • warden-client-3.0-beta1
  • warden-client-3.0-beta2
  • warden-client-3.0-beta3
  • warden-server-0.1.0
  • warden-server-2.0
  • warden-server-2.0.0-beta1
  • warden-server-2.1
  • warden-server-2.1-aplha1
  • warden-server-2.1-beta1
  • warden-server-2.1-beta2
  • warden-server-2.1-beta3
  • warden-server-2.1-beta4
  • warden-server-2.1-beta5
  • warden-server-2.1-beta6
  • warden-server-2.1-patch1
  • warden-server-2.2
  • warden-server-2.2-final
  • warden-server-2.2-patch1
  • warden-server-2.2-patch3
  • warden-server-3.0-beta0
  • warden-server-3.0-beta1
  • warden-server-3.0-beta2
  • warden-server-3.0-beta3
40 results

Target

Select target project
  • Pavel.Valach/warden
1 result
Select Git revision
  • devel
  • hruska-feature-#6799-filter-keys
  • hruska-feature-5066-duplicateIdeaID
  • hruska-feature-clients-api
  • malostik-#5066-deduplicate-idea-ids
  • master
  • warden-postgresql-port
  • warden-client-1.1.0
  • warden-client-1.2.0
  • warden-client-2.0
  • warden-client-2.0.0-beta1
  • warden-client-2.0.0-beta2
  • warden-client-2.1
  • warden-client-2.1-beta
  • warden-client-2.2
  • warden-client-2.2-final
  • warden-client-3.0-beta0
  • warden-client-3.0-beta1
  • warden-client-3.0-beta2
  • warden-client-3.0-beta3
  • warden-server-0.1.0
  • warden-server-2.0
  • warden-server-2.0.0-beta1
  • warden-server-2.1
  • warden-server-2.1-aplha1
  • warden-server-2.1-beta1
  • warden-server-2.1-beta2
  • warden-server-2.1-beta3
  • warden-server-2.1-beta4
  • warden-server-2.1-beta5
  • warden-server-2.1-beta6
  • warden-server-2.1-patch1
  • warden-server-2.2
  • warden-server-2.2-final
  • warden-server-2.2-patch1
  • warden-server-2.2-patch3
  • warden-server-3.0-beta0
  • warden-server-3.0-beta1
  • warden-server-3.0-beta2
  • warden-server-3.0-beta3
40 results
Show changes
Showing
with 0 additions and 1676 deletions
File deleted
b25340d3fe4105820f28dcaf52c740fde3956111 warden-server-2.2-alpha2.tar.gz
* customize wrapper's clown computing nodes selector
** set SERVER, IP, BASE (2x) variables in scripts
** http://meta.cesnet.cz/wiki/Pl%C3%A1novac%C3%AD_syst%C3%A9m_-_detailn%C3%AD_popis
* connect to any job submitter frontend (arda, skirit, ...)
** submit a job `qsub wtw-lenny-meta.sh`
** monitor it `qstat -u $USER`
* populate clients table
** set USER, PASS, DB (other/importMetaClients.sh)
** 'meta-nodes' must be in the same directory
** run;)
#!/bin/bash
USER=""
PASS=""
DB="warden"
if [ -z $PASS ]; then
MYSQL_CMD="mysql -u$USER $DB";
else
MYSQL_CMD="mysql -u$USER -p$PASS $DB";
fi
for host in `cat meta-nodes`; do
IP=`host $host | grep -v 'handle' | awk '{print $4}'`
echo "INSERT INTO clients VALUES (NULL, '$host', now(),'automatic', 'test', 's', NULL, 'n', 'bruteforce', '$IP/32');" | $MYSQL_CMD
done
tarkil10-1.cesnet.cz
tarkil10-2.cesnet.cz
tarkil11-1.cesnet.cz
tarkil11-2.cesnet.cz
tarkil12-1.cesnet.cz
tarkil12-2.cesnet.cz
tarkil13-1.cesnet.cz
tarkil13-2.cesnet.cz
tarkil14-1.cesnet.cz
tarkil14-2.cesnet.cz
tarkil15-1.cesnet.cz
tarkil15-2.cesnet.cz
tarkil17-1.cesnet.cz
tarkil17-2.cesnet.cz
tarkil18-1.cesnet.cz
tarkil18-2.cesnet.cz
tarkil19-1.cesnet.cz
tarkil19-2.cesnet.cz
tarkil20-1.cesnet.cz
tarkil20-2.cesnet.cz
tarkil21-1.cesnet.cz
tarkil21-2.cesnet.cz
tarkil22-1.cesnet.cz
tarkil22-2.cesnet.cz
tarkil23-1.cesnet.cz
tarkil23-2.cesnet.cz
tarkil24-1.cesnet.cz
tarkil24-2.cesnet.cz
tarkil25-1.cesnet.cz
tarkil25-2.cesnet.cz
tarkil26-1.cesnet.cz
tarkil26-2.cesnet.cz
tarkil27-1.cesnet.cz
tarkil27-2.cesnet.cz
tarkil5-1.cesnet.cz
tarkil5-2.cesnet.cz
tarkil7-1.cesnet.cz
tarkil7-2.cesnet.cz
tarkil9-1.cesnet.cz
tarkil9-2.cesnet.cz
konos20-1.fav.zcu.cz
perian55-1.ncbr.muni.cz
skirit51-1.ics.muni.cz
skirit51-2.ics.muni.cz
skirit52-1.ics.muni.cz
skirit52-2.ics.muni.cz
skirit53-1.ics.muni.cz
skirit53-2.ics.muni.cz
skirit54-1.ics.muni.cz
skirit54-2.ics.muni.cz
skirit55-1.ics.muni.cz
skirit55-2.ics.muni.cz
skirit56-1.ics.muni.cz
skirit56-2.ics.muni.cz
skirit57-1.ics.muni.cz
skirit57-2.ics.muni.cz
skirit58-1.ics.muni.cz
skirit58-2.ics.muni.cz
skirit59-1.ics.muni.cz
skirit59-2.ics.muni.cz
skirit60-1.ics.muni.cz
skirit60-2.ics.muni.cz
skirit61-1.ics.muni.cz
skirit61-2.ics.muni.cz
skirit62-1.ics.muni.cz
skirit62-2.ics.muni.cz
skirit63-1.ics.muni.cz
skirit63-2.ics.muni.cz
skirit64-1.ics.muni.cz
skirit64-2.ics.muni.cz
skirit65-1.ics.muni.cz
skirit65-2.ics.muni.cz
skirit67-1.ics.muni.cz
skirit67-2.ics.muni.cz
skirit68-1.ics.muni.cz
skirit68-2.ics.muni.cz
skirit69-1.ics.muni.cz
skirit69-2.ics.muni.cz
skirit70-1.ics.muni.cz
skirit70-2.ics.muni.cz
skirit71-1.ics.muni.cz
skirit71-2.ics.muni.cz
skirit72-1.ics.muni.cz
skirit72-2.ics.muni.cz
skirit73-1.ics.muni.cz
skirit73-2.ics.muni.cz
skirit74-1.ics.muni.cz
skirit74-2.ics.muni.cz
skirit75-1.ics.muni.cz
skirit75-2.ics.muni.cz
skirit76-1.ics.muni.cz
skirit76-2.ics.muni.cz
skirit77-1.ics.muni.cz
skirit77-2.ics.muni.cz
skirit78-1.ics.muni.cz
skirit78-2.ics.muni.cz
skirit79-1.ics.muni.cz
skirit79-2.ics.muni.cz
skirit84-1.ics.muni.cz
skirit84-2.ics.muni.cz
perian10-1.ncbr.muni.cz
perian10-2.ncbr.muni.cz
perian11-1.ncbr.muni.cz
perian11-2.ncbr.muni.cz
perian1-1.ncbr.muni.cz
perian12-1.ncbr.muni.cz
perian12-2.ncbr.muni.cz
perian1-2.ncbr.muni.cz
perian13-1.ncbr.muni.cz
perian13-2.ncbr.muni.cz
perian14-1.ncbr.muni.cz
perian14-2.ncbr.muni.cz
perian15-1.ncbr.muni.cz
perian15-2.ncbr.muni.cz
perian16-1.ncbr.muni.cz
perian16-2.ncbr.muni.cz
perian17-1.ncbr.muni.cz
perian17-2.ncbr.muni.cz
perian18-1.ncbr.muni.cz
perian18-2.ncbr.muni.cz
perian19-1.ncbr.muni.cz
perian19-2.ncbr.muni.cz
perian20-1.ncbr.muni.cz
perian20-2.ncbr.muni.cz
perian21-1.ncbr.muni.cz
perian21-2.ncbr.muni.cz
perian2-1.ncbr.muni.cz
perian22-1.ncbr.muni.cz
perian22-2.ncbr.muni.cz
perian2-2.ncbr.muni.cz
perian23-1.ncbr.muni.cz
perian23-2.ncbr.muni.cz
perian24-1.ncbr.muni.cz
perian24-2.ncbr.muni.cz
perian25-1.ncbr.muni.cz
perian25-2.ncbr.muni.cz
perian26-1.ncbr.muni.cz
perian26-2.ncbr.muni.cz
perian27-1.ncbr.muni.cz
perian27-2.ncbr.muni.cz
perian28-1.ncbr.muni.cz
perian28-2.ncbr.muni.cz
perian29-1.ncbr.muni.cz
perian29-2.ncbr.muni.cz
perian30-1.ncbr.muni.cz
perian30-2.ncbr.muni.cz
perian31-1.ncbr.muni.cz
perian31-2.ncbr.muni.cz
perian3-1.ncbr.muni.cz
perian32-1.ncbr.muni.cz
perian32-2.ncbr.muni.cz
perian3-2.ncbr.muni.cz
perian33-1.ncbr.muni.cz
perian33-2.ncbr.muni.cz
perian34-1.ncbr.muni.cz
perian34-2.ncbr.muni.cz
perian35-1.ncbr.muni.cz
perian35-2.ncbr.muni.cz
perian36-1.ncbr.muni.cz
perian36-2.ncbr.muni.cz
perian37-1.ncbr.muni.cz
perian37-2.ncbr.muni.cz
perian38-1.ncbr.muni.cz
perian38-2.ncbr.muni.cz
perian39-1.ncbr.muni.cz
perian39-2.ncbr.muni.cz
perian40-1.ncbr.muni.cz
perian40-2.ncbr.muni.cz
perian4-1.ncbr.muni.cz
perian4-2.ncbr.muni.cz
perian5-1.ncbr.muni.cz
perian5-2.ncbr.muni.cz
perian6-1.ncbr.muni.cz
perian6-2.ncbr.muni.cz
perian7-1.ncbr.muni.cz
perian7-2.ncbr.muni.cz
perian8-1.ncbr.muni.cz
perian8-2.ncbr.muni.cz
perian9-1.ncbr.muni.cz
perian9-2.ncbr.muni.cz
loslab1-1.ics.muni.cz
loslab1-2.ics.muni.cz
loslab2-1.ics.muni.cz
loslab2-2.ics.muni.cz
loslab3-1.ics.muni.cz
loslab3-2.ics.muni.cz
loslab4-1.ics.muni.cz
loslab4-2.ics.muni.cz
loslab5-1.ics.muni.cz
loslab5-2.ics.muni.cz
loslab6-1.ics.muni.cz
loslab6-2.ics.muni.cz
manwe3.ics.muni.cz
manwe4.ics.muni.cz
loslab1.ics.muni.cz
loslab2.ics.muni.cz
loslab3.ics.muni.cz
loslab4.ics.muni.cz
loslab5.ics.muni.cz
loslab6.ics.muni.cz
perian55-2.ncbr.muni.cz
skirit50.ics.muni.cz
skirit51.ics.muni.cz
skirit52.ics.muni.cz
skirit53.ics.muni.cz
skirit54.ics.muni.cz
skirit55.ics.muni.cz
skirit56.ics.muni.cz
skirit57.ics.muni.cz
skirit58.ics.muni.cz
skirit59.ics.muni.cz
skirit60.ics.muni.cz
skirit61.ics.muni.cz
skirit62.ics.muni.cz
skirit63.ics.muni.cz
skirit64.ics.muni.cz
skirit65.ics.muni.cz
skirit66.ics.muni.cz
skirit67.ics.muni.cz
skirit68.ics.muni.cz
skirit69.ics.muni.cz
skirit70.ics.muni.cz
skirit71.ics.muni.cz
skirit72.ics.muni.cz
skirit73.ics.muni.cz
skirit74.ics.muni.cz
skirit75.ics.muni.cz
skirit76.ics.muni.cz
skirit77.ics.muni.cz
skirit78.ics.muni.cz
skirit79.ics.muni.cz
skirit80.ics.muni.cz
skirit84.ics.muni.cz
perian10.ncbr.muni.cz
perian11.ncbr.muni.cz
perian12.ncbr.muni.cz
perian13.ncbr.muni.cz
perian14.ncbr.muni.cz
perian15.ncbr.muni.cz
perian16.ncbr.muni.cz
perian17.ncbr.muni.cz
perian18.ncbr.muni.cz
perian19.ncbr.muni.cz
perian1.ncbr.muni.cz
perian20.ncbr.muni.cz
perian21.ncbr.muni.cz
perian22.ncbr.muni.cz
perian23.ncbr.muni.cz
perian24.ncbr.muni.cz
perian25.ncbr.muni.cz
perian26.ncbr.muni.cz
perian27.ncbr.muni.cz
perian28.ncbr.muni.cz
perian29.ncbr.muni.cz
perian2.ncbr.muni.cz
perian30.ncbr.muni.cz
perian31.ncbr.muni.cz
perian32.ncbr.muni.cz
perian33.ncbr.muni.cz
perian34.ncbr.muni.cz
perian35.ncbr.muni.cz
perian36.ncbr.muni.cz
perian37.ncbr.muni.cz
perian38.ncbr.muni.cz
perian39.ncbr.muni.cz
perian3.ncbr.muni.cz
perian40.ncbr.muni.cz
perian4.ncbr.muni.cz
perian5.ncbr.muni.cz
perian6.ncbr.muni.cz
perian7.ncbr.muni.cz
perian8.ncbr.muni.cz
perian9.ncbr.muni.cz
tarkil10.cesnet.cz
tarkil11.cesnet.cz
tarkil12.cesnet.cz
tarkil13.cesnet.cz
tarkil14.cesnet.cz
tarkil15.cesnet.cz
tarkil17.cesnet.cz
tarkil18.cesnet.cz
tarkil19.cesnet.cz
tarkil20.cesnet.cz
tarkil21.cesnet.cz
tarkil22.cesnet.cz
tarkil23.cesnet.cz
tarkil24.cesnet.cz
tarkil25.cesnet.cz
tarkil26.cesnet.cz
tarkil27.cesnet.cz
tarkil5.cesnet.cz
tarkil7.cesnet.cz
tarkil9.cesnet.cz
konos10.fav.zcu.cz
konos1.fav.zcu.cz
konos2.fav.zcu.cz
konos3.fav.zcu.cz
konos4.fav.zcu.cz
konos5.fav.zcu.cz
konos6.fav.zcu.cz
konos7.fav.zcu.cz
konos8.fav.zcu.cz
konos9.fav.zcu.cz
tarkil8-1.cesnet.cz
tarkil8-2.cesnet.cz
tarkil8.cesnet.cz
alela1-1.feec.vutbr.cz
alela1-2.feec.vutbr.cz
alela1.feec.vutbr.cz
alela10-1.feec.vutbr.cz
alela10-2.feec.vutbr.cz
alela10.feec.vutbr.cz
alela11-1.feec.vutbr.cz
alela11-2.feec.vutbr.cz
alela11.feec.vutbr.cz
alela12-1.feec.vutbr.cz
alela12-2.feec.vutbr.cz
alela12.feec.vutbr.cz
alela2-1.feec.vutbr.cz
alela2-2.feec.vutbr.cz
alela2.feec.vutbr.cz
alela3-1.feec.vutbr.cz
alela3-2.feec.vutbr.cz
alela3.feec.vutbr.cz
alela4-1.feec.vutbr.cz
alela4-2.feec.vutbr.cz
alela4.feec.vutbr.cz
alela5-1.feec.vutbr.cz
alela5-2.feec.vutbr.cz
alela5.feec.vutbr.cz
alela6-1.feec.vutbr.cz
alela6-2.feec.vutbr.cz
alela6.feec.vutbr.cz
alela7-1.feec.vutbr.cz
alela7-2.feec.vutbr.cz
alela7.feec.vutbr.cz
alela8-1.feec.vutbr.cz
alela8-2.feec.vutbr.cz
alela8.feec.vutbr.cz
alela9-1.feec.vutbr.cz
alela9-2.feec.vutbr.cz
alela9.feec.vutbr.cz
konos15-1.fav.zcu.cz
konos15-2.fav.zcu.cz
konos15.fav.zcu.cz
konos17-1.fav.zcu.cz
konos17-2.fav.zcu.cz
konos17.fav.zcu.cz
konos18-1.fav.zcu.cz
konos18-2.fav.zcu.cz
konos18.fav.zcu.cz
konos20-2.fav.zcu.cz
konos20.fav.zcu.cz
konos22-1.fav.zcu.cz
konos22-2.fav.zcu.cz
konos22.fav.zcu.cz
konos27-1.fav.zcu.cz
konos27-2.fav.zcu.cz
konos27.fav.zcu.cz
konos30-1.fav.zcu.cz
konos30-2.fav.zcu.cz
konos30.fav.zcu.cz
konos34-1.fav.zcu.cz
konos34-2.fav.zcu.cz
konos34.fav.zcu.cz
hermes05-1.prf.jcu.cz
hermes05-2.prf.jcu.cz
hermes05.prf.jcu.cz
orca1-1.ics.muni.cz
orca1-2.ics.muni.cz
orca1.ics.muni.cz
orca10-1.ics.muni.cz
orca10-2.ics.muni.cz
orca10.ics.muni.cz
orca11-1.ics.muni.cz
orca11-2.ics.muni.cz
orca11.ics.muni.cz
orca12-1.ics.muni.cz
orca12-2.ics.muni.cz
orca12.ics.muni.cz
orca13-1.ics.muni.cz
orca13-2.ics.muni.cz
orca13.ics.muni.cz
orca14-1.ics.muni.cz
orca14-2.ics.muni.cz
orca14.ics.muni.cz
orca15-1.ics.muni.cz
orca15-2.ics.muni.cz
orca15.ics.muni.cz
orca16-1.ics.muni.cz
orca16-2.ics.muni.cz
orca16.ics.muni.cz
orca17-1.ics.muni.cz
orca17-2.ics.muni.cz
orca17.ics.muni.cz
orca18-1.ics.muni.cz
orca18-2.ics.muni.cz
orca18.ics.muni.cz
orca2-1.ics.muni.cz
orca2-2.ics.muni.cz
orca2.ics.muni.cz
orca3-1.ics.muni.cz
orca3-2.ics.muni.cz
orca3.ics.muni.cz
orca5-1.ics.muni.cz
orca5-2.ics.muni.cz
orca5.ics.muni.cz
orca6-1.ics.muni.cz
orca6-2.ics.muni.cz
orca6.ics.muni.cz
orca7-1.ics.muni.cz
orca7-2.ics.muni.cz
orca7.ics.muni.cz
orca8-1.ics.muni.cz
orca8-2.ics.muni.cz
orca8.ics.muni.cz
orca9-1.ics.muni.cz
orca9-2.ics.muni.cz
orca9.ics.muni.cz
quark11-1.video.muni.cz
quark11-2.video.muni.cz
quark11.video.muni.cz
quark12-1.video.muni.cz
quark12-2.video.muni.cz
quark12.video.muni.cz
quark13-1.video.muni.cz
quark13-2.video.muni.cz
quark13.video.muni.cz
quark14-1.video.muni.cz
quark14-2.video.muni.cz
quark14.video.muni.cz
quark15-1.video.muni.cz
quark15-2.video.muni.cz
quark15.video.muni.cz
quark6-1.video.muni.cz
quark6-2.video.muni.cz
quark6.video.muni.cz
quark7-1.video.muni.cz
quark7-2.video.muni.cz
quark7.video.muni.cz
hermes07-1.prf.jcu.cz
hermes07-2.prf.jcu.cz
hermes07.prf.jcu.cz
hermes08-1.prf.jcu.cz
hermes08-2.prf.jcu.cz
hermes08.prf.jcu.cz
hermes09-1.prf.jcu.cz
hermes09-2.prf.jcu.cz
hermes09.prf.jcu.cz
hermes10-1.prf.jcu.cz
hermes10-2.prf.jcu.cz
hermes10.prf.jcu.cz
hermes03-1.prf.jcu.cz
hermes03-2.prf.jcu.cz
hermes03.prf.jcu.cz
konos37-1.fav.zcu.cz
konos37-2.fav.zcu.cz
konos37.fav.zcu.cz
tarkil1-1.cesnet.cz
tarkil1-2.cesnet.cz
tarkil1.cesnet.cz
nympha1-1.zcu.cz
nympha1-2.zcu.cz
nympha1.zcu.cz
nympha2-1.zcu.cz
nympha2-2.zcu.cz
nympha2.zcu.cz
nympha3-1.zcu.cz
nympha3-2.zcu.cz
nympha3.zcu.cz
nympha4-1.zcu.cz
nympha4-2.zcu.cz
nympha4.zcu.cz
nympha5-1.zcu.cz
nympha5-2.zcu.cz
nympha5.zcu.cz
nympha6-1.zcu.cz
nympha6-2.zcu.cz
nympha6.zcu.cz
nympha7-1.zcu.cz
nympha7-2.zcu.cz
nympha7.zcu.cz
nympha8-1.zcu.cz
nympha8-2.zcu.cz
nympha8.zcu.cz
nympha9-1.zcu.cz
nympha9-2.zcu.cz
nympha9.zcu.cz
hermes06-1.prf.jcu.cz
hermes06-2.prf.jcu.cz
hermes06.prf.jcu.cz
quark9-1.video.muni.cz
quark9-2.video.muni.cz
quark9.video.muni.cz
konos16-1.fav.zcu.cz
konos16-2.fav.zcu.cz
konos16.fav.zcu.cz
konos24-1.fav.zcu.cz
konos24-2.fav.zcu.cz
konos24.fav.zcu.cz
konos26-1.fav.zcu.cz
konos26-2.fav.zcu.cz
konos26.fav.zcu.cz
konos36-1.fav.zcu.cz
konos36-2.fav.zcu.cz
konos36.fav.zcu.cz
nympha10-1.zcu.cz
nympha10-2.zcu.cz
nympha10.zcu.cz
tarkil16-1.cesnet.cz
tarkil16-2.cesnet.cz
tarkil16.cesnet.cz
tarkil2-1.cesnet.cz
tarkil2-2.cesnet.cz
tarkil2.cesnet.cz
ajax.zcu.cz
eru1.ruk.cuni.cz
eru2.ruk.cuni.cz
hermes02-1.prf.jcu.cz
hermes02-2.prf.jcu.cz
hermes02.prf.jcu.cz
nympha12-1.zcu.cz
nympha12-2.zcu.cz
nympha12.zcu.cz
nympha13-1.zcu.cz
nympha13-2.zcu.cz
nympha13.zcu.cz
nympha15-1.zcu.cz
nympha15-2.zcu.cz
nympha15.zcu.cz
nympha16-1.zcu.cz
nympha16-2.zcu.cz
nympha16.zcu.cz
nympha17-1.zcu.cz
nympha17-2.zcu.cz
nympha17.zcu.cz
nympha19-1.zcu.cz
nympha19-2.zcu.cz
nympha19.zcu.cz
quark10-1.video.muni.cz
quark10-2.video.muni.cz
quark10.video.muni.cz
quark8-1.video.muni.cz
quark8-2.video.muni.cz
quark8.video.muni.cz
hermes11-1.prf.jcu.cz
hermes11-2.prf.jcu.cz
hermes11.prf.jcu.cz
orca4-1.ics.muni.cz
orca4-2.ics.muni.cz
orca4.ics.muni.cz
hermes01-1.prf.jcu.cz
hermes01-2.prf.jcu.cz
hermes01.prf.jcu.cz
quark16-1.video.muni.cz
quark16-2.video.muni.cz
quark16.video.muni.cz
nympha11-1.zcu.cz
nympha11-2.zcu.cz
nympha11.zcu.cz
nympha18-1.zcu.cz
nympha18-2.zcu.cz
nympha18.zcu.cz
tarkil3-1.cesnet.cz
tarkil3-2.cesnet.cz
tarkil3.cesnet.cz
tarkil28-1.cesnet.cz
tarkil28-2.cesnet.cz
tarkil28.cesnet.cz
manwe1.ics.muni.cz
manwe2.ics.muni.cz
manwe5.ics.muni.cz
manwe6.ics.muni.cz
manwe7.ics.muni.cz
perian55.ncbr.muni.cz
skirit80-1.ics.muni.cz
tarkil4-1.cesnet.cz
tarkil4-2.cesnet.cz
tarkil4.cesnet.cz
tarkil6-1.cesnet.cz
tarkil6-2.cesnet.cz
tarkil6.cesnet.cz
nympha14-1.zcu.cz
nympha14-2.zcu.cz
nympha14.zcu.cz
skirit83.ics.muni.cz
skirit83-1.ics.muni.cz
skirit83-2.ics.muni.cz
luna3.fzu.cz
apollo1.fzu.cz
apollo2.fzu.cz
apollo3.fzu.cz
perian56-1.ncbr.muni.cz
perian56-2.ncbr.muni.cz
perian56.ncbr.muni.cz
perian41-1.ncbr.muni.cz
perian41-2.ncbr.muni.cz
perian41.ncbr.muni.cz
perian42-1.ncbr.muni.cz
perian42-2.ncbr.muni.cz
perian42.ncbr.muni.cz
perian43-1.ncbr.muni.cz
perian43-2.ncbr.muni.cz
perian43.ncbr.muni.cz
perian44-1.ncbr.muni.cz
perian44-2.ncbr.muni.cz
perian44.ncbr.muni.cz
perian45-1.ncbr.muni.cz
perian45-2.ncbr.muni.cz
perian45.ncbr.muni.cz
perian46-1.ncbr.muni.cz
perian46-2.ncbr.muni.cz
perian46.ncbr.muni.cz
perian47-1.ncbr.muni.cz
perian47-2.ncbr.muni.cz
perian47.ncbr.muni.cz
perian48-1.ncbr.muni.cz
perian48-2.ncbr.muni.cz
perian48.ncbr.muni.cz
perian49-1.ncbr.muni.cz
perian49-2.ncbr.muni.cz
perian49.ncbr.muni.cz
perian50-1.ncbr.muni.cz
perian50-2.ncbr.muni.cz
perian50.ncbr.muni.cz
perian51-1.ncbr.muni.cz
perian51-2.ncbr.muni.cz
perian51.ncbr.muni.cz
perian52-1.ncbr.muni.cz
perian52-2.ncbr.muni.cz
perian52.ncbr.muni.cz
perian53-1.ncbr.muni.cz
perian53-2.ncbr.muni.cz
perian53.ncbr.muni.cz
perian54-1.ncbr.muni.cz
perian54-2.ncbr.muni.cz
perian54.ncbr.muni.cz
skirit80-2.ics.muni.cz
minos1.zcu.cz
minos1-1.zcu.cz
minos1-2.zcu.cz
minos2.zcu.cz
minos2-1.zcu.cz
minos2-2.zcu.cz
minos3.zcu.cz
minos3-1.zcu.cz
minos3-2.zcu.cz
minos4.zcu.cz
minos4-1.zcu.cz
minos4-2.zcu.cz
minos5.zcu.cz
minos5-1.zcu.cz
minos5-2.zcu.cz
minos6.zcu.cz
minos6-1.zcu.cz
minos6-2.zcu.cz
minos7.zcu.cz
minos7-1.zcu.cz
minos7-2.zcu.cz
minos8.zcu.cz
minos8-1.zcu.cz
minos8-2.zcu.cz
minos9.zcu.cz
minos9-1.zcu.cz
minos9-2.zcu.cz
minos10.zcu.cz
minos10-1.zcu.cz
minos10-2.zcu.cz
minos11.zcu.cz
minos11-1.zcu.cz
minos11-2.zcu.cz
minos12.zcu.cz
minos12-1.zcu.cz
minos12-2.zcu.cz
minos13.zcu.cz
minos13-1.zcu.cz
minos13-2.zcu.cz
minos14.zcu.cz
minos14-1.zcu.cz
minos14-2.zcu.cz
minos15.zcu.cz
minos15-1.zcu.cz
minos15-2.zcu.cz
minos16.zcu.cz
minos16-1.zcu.cz
minos16-2.zcu.cz
minos17.zcu.cz
minos17-1.zcu.cz
minos17-2.zcu.cz
minos18.zcu.cz
minos18-1.zcu.cz
minos18-2.zcu.cz
minos19.zcu.cz
minos19-1.zcu.cz
minos19-2.zcu.cz
minos20.zcu.cz
minos20-1.zcu.cz
minos20-2.zcu.cz
minos21.zcu.cz
minos21-1.zcu.cz
minos21-2.zcu.cz
minos22.zcu.cz
minos22-1.zcu.cz
minos22-2.zcu.cz
minos23.zcu.cz
minos23-1.zcu.cz
minos23-2.zcu.cz
minos24.zcu.cz
minos24-1.zcu.cz
minos24-2.zcu.cz
minos25.zcu.cz
minos25-1.zcu.cz
minos25-2.zcu.cz
minos26.zcu.cz
minos26-1.zcu.cz
minos26-2.zcu.cz
minos27.zcu.cz
minos27-1.zcu.cz
minos27-2.zcu.cz
minos28.zcu.cz
minos28-1.zcu.cz
minos28-2.zcu.cz
minos29.zcu.cz
minos29-1.zcu.cz
minos29-2.zcu.cz
minos30.zcu.cz
minos30-1.zcu.cz
minos30-2.zcu.cz
minos31.zcu.cz
minos31-1.zcu.cz
minos31-2.zcu.cz
minos32.zcu.cz
minos32-1.zcu.cz
minos32-2.zcu.cz
minos33.zcu.cz
minos33-1.zcu.cz
minos33-2.zcu.cz
minos34.zcu.cz
minos34-1.zcu.cz
minos34-2.zcu.cz
minos35.zcu.cz
minos35-1.zcu.cz
minos35-2.zcu.cz
minos36.zcu.cz
minos36-1.zcu.cz
minos36-2.zcu.cz
minos37.zcu.cz
minos37-1.zcu.cz
minos37-2.zcu.cz
minos38.zcu.cz
minos38-1.zcu.cz
minos38-2.zcu.cz
minos39.zcu.cz
minos39-1.zcu.cz
minos39-2.zcu.cz
minos40.zcu.cz
minos40-1.zcu.cz
minos40-2.zcu.cz
minos41.zcu.cz
minos41-1.zcu.cz
minos41-2.zcu.cz
minos42.zcu.cz
minos42-1.zcu.cz
minos42-2.zcu.cz
minos43.zcu.cz
minos43-1.zcu.cz
minos43-2.zcu.cz
minos44.zcu.cz
minos44-1.zcu.cz
minos44-2.zcu.cz
minos45.zcu.cz
minos45-1.zcu.cz
minos45-2.zcu.cz
minos46.zcu.cz
minos46-1.zcu.cz
minos46-2.zcu.cz
minos47.zcu.cz
minos47-1.zcu.cz
minos47-2.zcu.cz
minos48.zcu.cz
minos48-1.zcu.cz
minos48-2.zcu.cz
minos49.zcu.cz
minos49-1.zcu.cz
minos49-2.zcu.cz
skirit66-1.ics.muni.cz
skirit66-2.ics.muni.cz
luna1.fzu.cz
mandos1.ics.muni.cz
mandos2.ics.muni.cz
mandos3.ics.muni.cz
mandos4.ics.muni.cz
mandos5.ics.muni.cz
mandos6.ics.muni.cz
mandos7.ics.muni.cz
mandos8.ics.muni.cz
mandos9.ics.muni.cz
mandos10.ics.muni.cz
mandos11.ics.muni.cz
mandos12.ics.muni.cz
mandos13.ics.muni.cz
mandos14.ics.muni.cz
#!/bin/bash
#Logovatko poctu prenesenych zprav na Warden server a vytizeni serveru
USER=root
PASS=
DB=warden
INT=1
QUERY="SELECT NOW(), COUNT( id ), COUNT(DISTINCT(note)) FROM events WHERE received > DATE_SUB(UTC_TIMESTAMP(), INTERVAL $INT MINUTE) AND service='test';"
M_OUT=`echo $QUERY | mysql -s -u$USER -p"$PASS" $DB`
U_OUT=`uptime | awk '{print $11}'`
RET="${M_OUT} ${U_OUT%?}"
echo $RET
File deleted
#!/bin/bash
#IP serveru
SERVER=""
PORT=""
#Cesta ke scriptum a zdrojakum, typicky AFS, napr. /afs/zcu.cz/users/v/vomacka/public/wardentest
BASE=""
HNAME=`hostname -f`
# STAGEIN
WDIR="/scratch/${PBS_O_LOGNAME}/wardentest.$$"
mkdir -p $WDIR || exit 1
cd $WDIR
tar xzf $BASE/warden-client-meta.tgz
perl -pi -e "s#\[path\]#$WDIR#" performance-sender.pm
perl -pi -e "s#\[path\]#$WDIR#" etc/warden-client.conf
perl -pi -e "s#\[server\]#$SERVER#" etc/warden-client.conf
perl -pi -e "s#\[port\]#$PORT#" etc/warden-client.conf
openssl req -new -nodes -keyform PEM -outform PEM -config ./ca/openssl.cnf -keyout ./ca/server-key.pem -out ./ca/server.csr -subj "/CN=$HNAME" -days 365
openssl ca -batch -keyform PEM -passin pass:test -name client_ca -config ./ca/openssl.cnf -out ./ca/server-cert.pem -infiles ./ca/server.csr
# JOB
for i in `seq 1 1000`; do
./performance-sender.pm test 10 &> /dev/null
done
date
# STAGEOUT
#cp p1.log $BASE/output-p1.log.$PBS_JOBID.$HNAME
#cp p2.log $BASE/output-p2.log.$PBS_JOBID.$HNAME
cd /tmp
rm -rf $WDIR
#!/bin/bash
#PBS -N wtw-lenny.sh
#PBS -q short
#PBS -l nodes=1:ppn=1:^cl_luna
#PBS -j oe
#PBS -m abe
#
# describtion from 'man qsub':
# -N ... declares a name for the job. The name specified may be up to and including 15 characters in length. It
# must consist of printable, non white space characters with the first character alphabetic.
# -q ... defines the destination of the job (queue)
# -l ... defines the resources that are required by the job
# -j oe ... standard error stream of the job will be merged with the standard output stream
# -m ace ... mail is sent anytime
#in file name of which can be found in variable PBS_NODEFILE, is list of allocated machines
echo '***PBS_NODEFILE***START*******'
cat $PBS_NODEFILE
echo '***PBS_NODEFILE***END*********'
#Cesta ke scriptum a zdrojakum, typicky AFS, napr. /afs/zcu.cz/users/v/vomacka/public/wardentest
BASE=""
cd $BASE || exit 1
# spusti dany prikaz na vsech pridelenych strojich
pbsdsh -o -- bash ${BASE}/wardentest-lenny-meta.sh
package DNSblacklist;
use strict;
use warnings;
use Data::Dumper;
my %CONSTANTS = (
target => "127.0.0.2",
outputfile => "tmp/blacklist.csv",
threshold => 10,
excludedip => [],
eventtype => [],
maxage => "1D",
ttl => "3600",
zone => "@",
dns => "dns.example.com",
hostmaster => "hostmaster\@example.com",
refresh => "1800 ; refresh (30 minutes)",
retry => "600 ; retry (10 minutes)",
expire => "1209600 ; expire (2 weeks)",
minimum => "86400 ; minimum (1 day)",
);
my %FORMAT = ( maxage => qr/\d+[hdmHDM]/, );
sub run {
my (undef, $modprefix, $cfg, $dbh, $db_engine) = @_;
my $v = Constants::mergeConfigs($cfg, $modprefix, \%CONSTANTS, \%FORMAT);
my $eventtype_query = DB::joinIN("type", \@{$v->{'eventtype'}});
my $excluded_query = DB::joinNotIN("source", \@{$v->{'excludedip'}});
my $condition = substr($excluded_query . $eventtype_query, 0, -5);
my @columns= ("source", "note");
my @params = ($condition, DB::getOldDataDB($db_engine, "NEWER", $v->{'maxage'}));
my $query = DB::getQueryCondThreshold($db_engine, "events", \@columns, \@params, $v->{'threshold'});
my @rows = Utils::fetchall_array_hashref($dbh, $query);
my ($sec, $min, $hr, $day, $mon, $year) = localtime;
$v->{'serial'} = sprintf("%02d%02d%02d%02d%02d", $year - 100 , $mon + 1, $day, $hr, $min);
$v->{'hostmaster'} =~ s/\@/\./;
sub header { my $v = shift; return "\$ORIGIN .\n\$TTL $v->{'ttl'}\n$v->{'zone'}\t\t\t\t\t\tIN\tSOA\t$v->{'dns'}. $v->{'hostmaster'}. (\n\t\t\t\t\t\t\t\t$v->{'serial'} ; serial\n\t\t\t\t\t\t\t\t$v->{'refresh'}\n\t\t\t\t\t\t\t\t$v->{'retry'}\n\t\t\t\t\t\t\t\t$v->{'expire'}\n\t\t\t\t\t\t\t\t$v->{'minimum'}\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\tNS\t$v->{'dns'}.\n"; };
sub record { my ($r, $v) = @_; $r->{'note'} = "" if !defined $r->{'note'}; return ";" . "$r->{'source'}\n" . join(".", reverse( split(/\./, $r->{'source'}))) . "\t\tIN\t\tA\t$v->{'target'}\n\t\t\t\t\tIN\t\tTXT\t\"$r->{'note'}\"\n"; };
my $ret = Utils::generateOutput($v->{'outputfile'}, \@rows, \&header, \&record, undef, $v);
return $ret;
}
1;
package IPblacklist;
use strict;
use warnings;
use Data::Dumper;
my %CONSTANTS = (
outputfile => "tmp/blacklist.csv",
threshold => 200,
excludedip => [],
eventtype => [],
maxage => "1D",
);
my %FORMAT = ( maxage => qr/\d+[hdmHDM]/, );
sub run {
my (undef, $modprefix, $cfg, $dbh, $db_engine) = @_;
my $v = Constants::mergeConfigs($cfg, $modprefix, \%CONSTANTS, \%FORMAT);
my $eventtype_query = DB::joinIN("type", \@{$v->{'eventtype'}});
my $excluded_query = DB::joinNotIN("source", \@{$v->{'excludedip'}});
my $condition = substr($excluded_query . $eventtype_query, 0, -5);
my @columns= ("source");
my @params = ($condition, DB::getOldDataDB($db_engine, "NEWER", $v->{'maxage'}));
my $query = DB::getQueryCondThreshold($db_engine, "events", \@columns, \@params, $v->{'threshold'});
my @rows = Utils::fetchall_array_hashref($dbh, $query);
sub record { my $r = shift; return "$r->{'source'},\n"; };
my $ret = Utils::generateOutput($v->{'outputfile'}, \@rows, undef, \&record, undef, $v);
return $ret;
}
1;
package IPset;
use strict;
use warnings;
use Data::Dumper;
my %CONSTANTS = (
enabled => "no",
outputfile => "tmp/ipset.txt",
threshold => 250,
excludedip => [],
eventtype => [],
setname => "BLOCK",
maxage => "1D",
);
my %FORMAT = ( maxage => qr/\d+[hdmHDM]/, logging => qr/enable|disable/,);
sub run {
my (undef, $modprefix, $cfg, $dbh, $db_engine) = @_;
my $v = Constants::mergeConfigs($cfg, $modprefix, \%CONSTANTS, \%FORMAT);
my $eventtype_query = DB::joinIN("type", \@{$v->{'eventtype'}});
my $excluded_query = DB::joinNotIN("source", \@{$v->{'excludedip'}});
my $condition = substr($excluded_query . $eventtype_query, 0, -5);
my @columns= ("source");
my @params = ($condition, DB::getOldDataDB($db_engine, "NEWER", $v->{'maxage'}));
my $query = DB::getQueryCondThreshold($db_engine, "events", \@columns, \@params, $v->{'threshold'});
my @rows = Utils::fetchall_array_hashref($dbh, $query);
sub header { my $v = shift; return "create $v->{'setname'}_tmp hash:ip\n"; };
sub record { my ($r, $v) = @_; return "add $v->{'setname'}_tmp $r->{'source'}\n" if ($r->{'source'}=~/\d+\.\d+\.\d+\.\d+/); };
sub footer { my ($v) = @_; return "swap $v->{'setname'}_tmp $v->{'setname'}\ndestroy $v->{'setname'}_tmp\nquit\n"; };
my $ret = Utils::generateOutput($v->{'outputfile'}, \@rows, \&header, \&record, \&footer, $v);
return $ret;
}
1;
package IPtables;
use strict;
use warnings;
use Data::Dumper;
my %CONSTANTS = (
enabled => "no",
outputfile => "tmp/iptables.txt",
threshold => 250,
excludedip => [],
eventtype => [],
chainname => "BLOCK",
destchain => "DROP",
maxage => "1D",
);
my %FORMAT = ( maxage => qr/\d+[hdmHDM]/, logging => qr/enable|disable/,);
sub run {
my (undef, $modprefix, $cfg, $dbh, $db_engine) = @_;
my $v = Constants::mergeConfigs($cfg, $modprefix, \%CONSTANTS, \%FORMAT);
my $eventtype_query = DB::joinIN("type", \@{$v->{'eventtype'}});
my $excluded_query = DB::joinNotIN("source", \@{$v->{'excludedip'}});
my $condition = substr($excluded_query . $eventtype_query, 0, -5);
my @columns= ("source");
my @params = ($condition, DB::getOldDataDB($db_engine, "NEWER", $v->{'maxage'}));
my $query = DB::getQueryCondThreshold($db_engine, "events", \@columns, \@params, $v->{'threshold'});
my @rows = Utils::fetchall_array_hashref($dbh, $query);
sub header { my $v = shift; return "/sbin/iptables -F $v->{'chainname'}\n"; };
sub record { my ($r, $v) = @_; return "/sbin/iptables -A $v->{'chainname'} -s $r->{'source'}/32 -j $v->{'destchain'}\n"; };
my $ret = Utils::generateOutput($v->{'outputfile'}, \@rows, \&header, \&record, undef, $v);
return $ret;
}
1;
package MailReport;
use strict;
use warnings;
my %CONSTANTS = (
tool => "sendmail",
sender => "",
recipients => [],
subject => "",
subnets => ["147."],
signature => "XXX",
threshold => 0,
excludedsensor => [],
excludedip => [],
eventtype => [],
maxage => "1D",
summary => "yes",
);
my %FORMAT = ( maxage => qr/\d+[hdmHDM]/,
tool => qr/(ssmtp|sendmail)/,
);
sub run {
my (undef, $modprefix, $cfg, $dbh, $db_engine) = @_;
my $v = Constants::mergeConfigs($cfg, $modprefix, \%CONSTANTS, \%FORMAT);
my $eventtype_query = DB::joinIN("type", \@{$v->{'eventtype'}});
my $excluded_query = DB::joinNotIN("source", \@{$v->{'excludedip'}});
my $excludedsensor_query = DB::joinNotIN("service", \@{$v->{'excludedsensor'}});
my $subnets_query = DB::joinLIKE("source", \@{$v->{'subnets'}});
my $condition = substr($excluded_query . $eventtype_query . $excludedsensor_query . $subnets_query, 0, -5);
my @columns= ("source", "hostname", "service", "type", "detected", "target_proto", "target_port", "attack_scale");
my @params = ($condition, DB::getOldDataDB($db_engine, "NEWER", $v->{'maxage'}));
my $query = DB::getQueryCondThreshold($db_engine, "events", \@columns, \@params, $v->{'threshold'});
my @rows = Utils::fetchall_array_hashref($dbh, $query);
if($v->{'subject'} eq "") {
my $hostname = `hostname -f`;
$v->{'subject'} = "$modprefix (Warden-app) on $hostname";
}
$v->{'modprefix'} = $modprefix;
sub header {
my $v = shift;
my $header;
$header = "$v->{'modprefix'} noticed following events during $v->{'maxage'} timeframe:\n\n";
$header .= sprintf("+-------------------------------+---------------------+------------+-----------------+-------+----------+--------+\n");
$header .= sprintf("| Detector/Service | Detected | Type | Source | Dport | Proto | Volume |\n");
$header .= sprintf("+-------------------------------+---------------------+------------+-----------------+-------+----------+--------+\n");
return $header
};
sub record { my $r = shift; return sprintf("|%30s | %19s | %10s | %15s | %5s | %8s | %6s |\n", "$r->{'hostname'}/$r->{'service'}", $r->{'detected'}, $r->{'type'}, $r->{'source'}, $r->{'target_port'}, $r->{'target_proto'}, $r->{'attack_scale'}); };
sub footer {
my $v = shift;
my $footer = sprintf("+-------------------------------+---------------------+------------+-----------------+-------+----------+--------+\n\n");
$footer .= $v->{'signature'};
return $footer;
};
Utils::generateEmails($v->{'tool'}, \@{$v->{'recipients'}}, $v->{'sender'}, $v->{'subject'}, \@rows, \&header, \&record, \&footer, $v, $v->{'summary'});
return 1;
}
1;
package Constants;
use strict;
use warnings;
use Data::Dumper;
use constant SCALAR => 'SCALAR';
our %DEFAULTS =
(
factory => {
GENERAL_logfile => "var/log/factory.log",
GENERAL_modpath => "Modules",
},
receiver => {
GENERAL_method => ( "stdout" ),
GENERAL_logfile => "var/log/receiver.log",
GENERAL_wardenpath => "/opt/warden/client",
GENERAL_requested_type => "",
FILE_directory => "var/fileout/",
FILE_method => "append",
FILE_appendfilename => "received",
FILE_extension => "csv",
DB_dbengine => "sqlite",
},
db => {
SQLITE_db => "var/db.sqlite",
SQLITE_user => "",
SQLITE_pass => "",
MYSQL_db => "warden",
MYSQL_user => "root",
MYSQL_pass => "",
MYSQL_host => "localhost",
MYSQL_port => "3306",
},
cleaner => {
GENERAL_method => ( "db" ),
GENERAL_maxage => "11D",
},
);
sub getDefaultValue {
my ($valuename, $section) = @_;
$valuename =~ s/\./_/g;
my @value = $DEFAULTS{$section}{$valuename};
die "Value '$valuename' is not defined" if not @value;
return (wantarray ? @value : $value[0]);
}
sub assignValue {
my ($valuename, $cfg, $section, $nocheck) = @_;
my @configvalue = $cfg->param($valuename);
$valuename =~ s/\./_/g;
my @value;
if(!defined $nocheck) {
my @defaultvalue = getDefaultValue($valuename, $section);
@value = (@configvalue ? @configvalue : @defaultvalue);
}
else {
@value = @configvalue;
}
die "Value '$valuename' is not defined" if not defined $value[0];
if(wantarray and $value[0] eq "") {
return ();
}
else {
return (wantarray ? @value : $value[0]);
}
}
sub mergeConfigs {
my ($config, $section, $constants, $format) = @_;
my %ret;
my $conf_hash = $config->get_block($section);
foreach my $const_key ( keys %$constants )
{
if( exists $conf_hash->{$const_key} ) {
if(ref($constants->{$const_key}) eq ref($conf_hash->{$const_key})) {
$ret{$const_key} = $conf_hash->{$const_key};
}
elsif (ref($constants->{$const_key}) eq 'ARRAY') {
$ret{$const_key} = (defined $conf_hash->{$const_key} ? [$conf_hash->{$const_key}] : []);
}
elsif (ref(\$constants->{$const_key}) eq 'SCALAR') {
$ret{$const_key} = (defined $conf_hash->{$const_key} ? $conf_hash->{$const_key}->[0] : "");
}
if(exists $format->{$const_key}) {
if($ret{$const_key} !~ $format->{$const_key}) {
$ret{$const_key} = $constants->{$const_key};
}
}
}
else {
$ret{$const_key} = $constants->{$const_key};
}
}
return \%ret;
}
package DB;
use strict;
use warnings;
use WardenApp::Constants;
use constant DB_ENGINE_MYSQL => 'mysql';
use constant DB_ENGINE_SQLITE => 'sqlite';
use constant DB_SECTION => 'db';
use DBI;
sub connectDB {
my ($cfg, $db_engine) = @_;
my $dbh;
if(lc $db_engine eq DB_ENGINE_MYSQL) {
my $db = Constants::assignValue('MYSQL.db', $cfg, DB_SECTION);
my $host = Constants::assignValue('MYSQL.host', $cfg, DB_SECTION);
my $user = Constants::assignValue('MYSQL.user', $cfg, DB_SECTION);
my $pass = Constants::assignValue('MYSQL.pass', $cfg, DB_SECTION);
my $port = Constants::assignValue('MYSQL.port', $cfg, DB_SECTION);
$dbh = DBI->connect("DBI:mysql:host=" . $host . ";port=" . $port . ";database=" . $db,
$user,
$pass,
{RaiseError => 0,AutoCommit => 0}) || die "Database connection not made: $DBI::errstr";
}
elsif (lc $db_engine eq DB_ENGINE_SQLITE) {
my $db = Constants::assignValue('SQLITE.db', $cfg, DB_SECTION);
my $user = Constants::assignValue('SQLITE.user', $cfg, DB_SECTION);
my $pass = Constants::assignValue('SQLITE.pass', $cfg, DB_SECTION);
$dbh = DBI->connect("DBI:SQLite:" . $db,
$user,
$pass,
{RaiseError => 0,AutoCommit => 1}) || die "Database connection not made: $DBI::errstr";
}
return \$dbh;
}
sub getOldDataDB {
my ($db_engine, $expr, $maxage) = @_;
my ($num, $word) = $maxage =~ /(\d+)([dmhDMH])/;
my ($word_long, $word_desc);
$word_long = "HOUR" if $word =~ /[hH]/;
$word_long = "DAY" if $word =~ /[dD]/;
$word_long = "MONTH" if $word =~ /[mM]/;
my $c;
$c = "<" if($expr eq "OLDER");
$c = ">" if($expr eq "NEWER");
if($db_engine eq DB_ENGINE_MYSQL) {
return sprintf("detected %s DATE_SUB(NOW(), INTERVAL %d %s)", $c, $num, $word_long);
}
if($db_engine eq DB_ENGINE_SQLITE) {
return sprintf("datetime(detected) %s datetime('now','-%d %s')", $c, $num, $word_long);
}
return "";
}
sub closeDB {
my $dbh = shift;
$$dbh->disconnect;
}
sub getQueryCondThreshold {
my ($db_engine, $table, $columns, $params, $threshold) = @_;
my $columns_q = join ", ", @$columns;
my $params_q = join " AND ", grep { $_ } @$params;
return sprintf("SELECT %s FROM %s WHERE %s GROUP BY source HAVING COUNT(id) > %s", $columns_q, $table, $params_q, $threshold);
}
sub joinIN {
my ($column, $data) = @_;
return (@$data ? sprintf("%s IN (%s) AND ", $column, join ",", map { "'$_'" } @$data) : "");
}
sub joinNotIN {
my ($column, $data) = @_;
return (@$data ? sprintf("%s NOT IN (%s) AND ", $column, join ",", map { "'$_'" } @$data) : "");
}
sub joinLIKE {
my ($column, $data) = @_;
my $ret = (@$data ? sprintf("%s", join ",", map { "$column LIKE '$_%' OR " } @$data) : "");
return ($ret ne "" ? substr($ret, 0, -4) . " AND " : "");
}
1;
package Factory;
use strict;
use warnings;
use Config::Simple;
use WardenApp::Constants;
use WardenApp::DB;
use WardenApp::Utils;
use Data::Dumper;
use constant TRUE => 1;
use constant FALSE => 0;
use constant ENABLED => 'yes';
use constant DB_ENGINE_MYSQL => 'mysql';
use constant DB_ENGINE_SQLITE => 'sqlite';
use constant FACTORY_SECTION => 'factory';
use constant CFG_MODULE_DIR => 'GENERAL.modpath';
sub isModEnabled {
my ($modprefix, $cfg) = @_;
my $enabled = Constants::assignValue($modprefix . ".enabled", $cfg, FACTORY_SECTION);
if ($enabled eq ENABLED) {
return TRUE;
}
else {
return FALSE;
}
}
sub runModule {
my ($modulename, $cfg, $dbh, $db_engine) = @_;
unless(isModEnabled($modulename, $cfg)) {
print "Module '$modulename' disabled! See configuration file!\n";
return 0;
}
my $moddir = Constants::assignValue(CFG_MODULE_DIR, $cfg, FACTORY_SECTION);
my $module = Constants::assignValue($modulename . ".module", $cfg, FACTORY_SECTION, "nocheck");
require "$moddir/$module.pm";
print "Module '$modulename' started\n";
my $ret = $module->run($modulename, $cfg, $dbh, $db_engine);
if($ret) {
print "Module '$modulename' finished\n";
return 1;
}
else {
print "Module '$modulename' finished with errors\n";
return 0;
}
}
1;
package Receiver;
use strict;
use warnings;
use WardenApp::Constants;
use constant RECEIVER_SECTION => 'receiver';
use constant SQL_INSERT_EVENT => "INSERT INTO events VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)";
sub openfile {
my ($cfg) = @_;
my ($filename, $openparam);
my $method = Constants::assignValue('FILE.method', $cfg, RECEIVER_SECTION);
if($method ne 'newfile' and $method ne 'append') {
$method = Constants::getDefaultValue('FILE.method', RECEIVER_SECTION);
}
if($method eq 'newfile') {
my ($sec, $min, $hr, $day, $mon, $year) = localtime;
$openparam = ">";
$filename = sprintf("%02d-%02d-%04d_%02d-%02d", $day, $mon + 1, 1900 + $year, $hr, $min);
}
elsif ($method eq 'append') {
$openparam = ">>";
$filename = Constants::assignValue('FILE.appendfilename', $cfg, RECEIVER_SECTION);
}
my $directory = Constants::assignValue('FILE.directory', $cfg, RECEIVER_SECTION);
my $extension = Constants::assignValue('FILE.extension', $cfg, RECEIVER_SECTION);
my $openstring = $openparam . $directory . "/" . $filename . "." . $extension;
open FILE, $openstring or die $!;
return \*FILE;
}
sub saveToDB {
my ($dbh, $event, $db_engine) = @_;
my $sth = $$dbh->prepare(SQL_INSERT_EVENT);
#my $data = join(',', @$event);
$sth->execute(@$event) || die $sth->errstr;
print "Receiver-$db_engine:\tError \"$@\" while processing data\n" if $@;
}
sub saveToFile {
my ($file, $event) = @_;
my $data = join(';', @$event);
print $file $data . "\n";
}
sub printToStdout {
my $event = shift;
print "| " . join(' | ', @$event ) . " |" . "\n";
}
sub closeFile {
my $file = shift;
close $file;
}
1;
package Utils;
use strict;
use warnings;
use Data::Dumper;
sub generateOutput {
my ($outputfile, $rows, $header, $record, $footer, $values) = @_;
return 0 if not defined $record;
if(open FILE, ">$outputfile") {
print FILE &$header($values) if defined $header;
foreach my $r (@$rows) {
my $record_alt = &$record($r, $values);
print FILE $record_alt;
}
print FILE &$footer($values) . "\n" if defined $footer;
close FILE;
return 1;
}
else {
return 0;
}
}
sub generateEmails {
my ($tool, $to, $from, $subject, $rows, $header, $record, $footer, $values, $summary) = @_;
my ($msg, $body) = ("", "");
if($summary eq "yes") {
foreach my $r (@$rows) {
$body .= &$record($r, $values) if defined $record;
}
if($body ne "") {
$msg .= &$header($values) if defined $header;
$msg .= $body;
$msg .= &$footer($values) if defined $footer;
foreach my $recipient (@$to) {
sendEmail($tool, $recipient, $from, $subject, $msg) if defined $record;
}
}
}
else {
foreach my $r (@$rows) {
$msg = "";
$msg .= &$header($values) if defined &$header;
$msg .= &$record($r, $values);
$msg .= &$footer($values) . "\n" if defined $footer;
if(defined $record) {
foreach my $recipient (@$to) {
sendEmail($tool, $recipient, $from, $subject, $msg) if defined $record;
}
}
}
}
}
sub sendEmail {
my($tool, $to, $from, $subject, $body) = @_;
if(($from !~ /^(\w|\-|\_|\.)+\@((\w|\-|\_)+\.)+[a-zA-Z]{2,}$/) || ($from =~ /\.@|\.\./)) {
print "Senders address ('$from') is not valid!\n";
return 0;
}
if(($to !~ /^(\w|\-|\_|\.)+\@((\w|\-|\_)+\.)+[a-zA-Z]{2,}$/) || ($to =~ /\.@|\.\./)) {
print "Recipients address ('$to') is not valid!\n";
return 0;
}
if($subject eq "") {
print "Subject cannot be empty!\n";
return 0;
}
if(open(MAIL, "|/usr/sbin/$tool -t")) {
print MAIL "To: $to\n";
print MAIL "From: $from\n";
print MAIL "Subject: $subject\n\n";
print MAIL "$body";
close(MAIL);
return 1;
}
else {
return (0, "Sending email failed: $!");
}
}
sub fetchall_array_hashref {
my ($dbh, $query) = @_;
my $sth = $$dbh->prepare($query);
$sth->execute();
my (@rows, $x);
push(@rows, $x) while ($x = $sth->fetchrow_hashref());
return @rows;
}
1;
#!/usr/bin/perl
use strict;
use warnings;
use FindBin qw($Bin);
use lib "$Bin/../";
use WardenApp::DB;
use WardenApp::Constants;
use Config::Simple;
use constant GENERAL_CONFIG_FILE => "$Bin/../etc/cleaner.conf";
use constant DB_CONFIG_FILE => "$Bin/../etc/db.conf";
use constant RECV_CONFIG_FILE => "$Bin/../etc/receiver.conf";
use constant RECEIVER_SECTION => 'receiver';
use constant CLEANER_SECTION => 'cleaner';
use constant DB_ENGINE_MYSQL => 'mysql';
use constant DB_ENGINE_SQLITE => 'sqlite';
use constant TRUE => 1;
use constant FALSE => 0;
my $cfg = new Config::Simple;
$cfg->read(GENERAL_CONFIG_FILE) or die $cfg->error();
my $cfg_rcv = new Config::Simple;
$cfg_rcv->read(RECV_CONFIG_FILE) or die $cfg_rcv->error();
my $cfg_db = new Config::Simple;
$cfg_db->read(DB_CONFIG_FILE) or die $cfg_db->error();
my @general_method = Constants::assignValue('GENERAL.method', $cfg, CLEANER_SECTION);
my $general_method_db = (grep (/db/, @general_method) ? TRUE : FALSE);
my $general_maxage = Constants::assignValue('GENERAL.maxage', $cfg, CLEANER_SECTION);
$general_maxage = Constants::getDefaultValue('GENERAL.maxage', CLEANER_SECTION) if $general_maxage !~ /\d+[hdmHDM]/;
if($general_method_db) {
my $db_engine = Constants::assignValue('DB.dbengine', $cfg_rcv, RECEIVER_SECTION);
my $dbh = DB::connectDB($cfg_db, $db_engine);
if($dbh) {
my $query = sprintf("DELETE FROM events WHERE %s", DB::getOldDataDB($db_engine, "OLDER", $general_maxage));
my $sth = $$dbh->prepare($query);
$sth->execute;
my $num_deleted = $sth->rows;
print "Removed '$num_deleted' events older than $general_maxage.\n";
DB::closeDB($dbh);
exit 1;
}
else {
exit 0;
}
}
else {
print "General DB method is not configured\n";
exit 0;
}