Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 1363

Přidáno uživatelem Michal Kliment před více než 12 roky(ů)

Pridan jednoduchy monitoring zarizeni (implementace #118). Opraveno #142.

Zobrazit rozdíly:

freenetis/branches/testing/media/images/icons/keep.svg
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
version="1.0"
width="16"
height="16"
id="svg2486">
<defs
id="defs2488">
<linearGradient
id="linearGradient2490">
<stop
id="stop2492"
style="stop-color:#791235;stop-opacity:1"
offset="0" />
<stop
id="stop2494"
style="stop-color:#dd3b27;stop-opacity:1"
offset="1" />
</linearGradient>
<linearGradient
x1="18.379412"
y1="44.980297"
x2="18.379412"
y2="3.0816143"
id="linearGradient2484"
xlink:href="#linearGradient2490"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.3685738,0,0,0.3685738,-0.84577,-0.8457701)" />
<linearGradient
id="linearGradient3242">
<stop
id="stop3244"
style="stop-color:#f8b17e;stop-opacity:1"
offset="0" />
<stop
id="stop3246"
style="stop-color:#e35d4f;stop-opacity:1"
offset="0.26238" />
<stop
id="stop3248"
style="stop-color:#c6262e;stop-opacity:1"
offset="0.66093999" />
<stop
id="stop3250"
style="stop-color:#690b54;stop-opacity:1"
offset="1" />
</linearGradient>
<radialGradient
cx="23.895569"
cy="3.9900031"
r="20.397499"
fx="23.895569"
fy="3.9900031"
id="radialGradient2482"
xlink:href="#linearGradient3242"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0,0.8796593,-1.1611346,0,12.632931,-21.08413)" />
<linearGradient
id="linearGradient4873">
<stop
id="stop4875"
style="stop-color:#ffffff;stop-opacity:1"
offset="0" />
<stop
id="stop4877"
style="stop-color:#ffffff;stop-opacity:0"
offset="1" />
</linearGradient>
<linearGradient
x1="63.397362"
y1="-12.489107"
x2="63.397362"
y2="5.4675598"
id="linearGradient2479"
xlink:href="#linearGradient4873"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.7432394,0,0,0.7432224,-38.229789,10.609333)" />
<linearGradient
x1="7.8322024"
y1="10.935848"
x2="18.67845"
y2="10.935848"
id="linearGradient2432"
gradientUnits="userSpaceOnUse"
gradientTransform="scale(0.9325827,1.0722909)">
<stop
id="stop2434"
style="stop-color:#ffffff;stop-opacity:1"
offset="0" />
<stop
id="stop2436"
style="stop-color:#ffffff;stop-opacity:0"
offset="1" />
</linearGradient>
<linearGradient
x1="7.8322024"
y1="10.935848"
x2="18.67845"
y2="10.935848"
id="linearGradient2476"
xlink:href="#linearGradient2432"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.6660814,0,0,0.7658657,-0.570797,-0.5707967)" />
</defs>
<g
id="layer1">
<path
d="M 8.0000011,0.50182787 C 3.862769,0.50182787 0.501827,3.862767 0.501827,7.9999996 C 0.501827,12.137233 3.862769,15.498175 8.0000011,15.498172 C 12.137232,15.498172 15.498177,12.137233 15.498173,7.9999996 C 15.498173,3.862767 12.137232,0.50182787 8.0000011,0.50182787 z M 8.0000011,2.9090753 C 10.812762,2.9090753 13.090926,5.1872403 13.090926,7.9999996 C 13.090926,9.1804926 12.681905,10.258088 12.008239,11.121359 L 5.558201,3.5310432 C 6.28288,3.1345282 7.115286,2.9090753 8.0000011,2.9090753 z M 3.922653,4.9592664 L 10.349659,12.515029 C 9.6467221,12.881248 8.8478301,13.090926 8.0000011,13.090926 C 5.187241,13.090926 2.909076,10.81276 2.909076,7.9999996 C 2.909076,6.8573167 3.287583,5.808591 3.922653,4.9592664 z"
id="path2555"
style="fill:url(#radialGradient2482);fill-opacity:1;stroke:url(#linearGradient2484);stroke-width:1.00365424;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<path
d="M 14.500001,7.9997709 C 14.500001,11.589737 11.589636,14.5 8.0000818,14.5 C 4.4101984,14.5 1.5000001,11.589705 1.5000001,7.9997709 C 1.5000001,4.4099703 4.4101984,1.5000014 8.0000818,1.5000014 C 11.589636,1.5000014 14.500001,4.4099703 14.500001,7.9997709 L 14.500001,7.9997709 z"
id="path2463"
style="opacity:0.4;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:url(#linearGradient2479);stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
d="M 4.8517868,4.2102172 L 11.235855,11.701806"
id="path3270"
style="opacity:0.4;fill:none;fill-rule:evenodd;stroke:url(#linearGradient2476);stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1" />
</g>
</svg>
freenetis/branches/testing/media/images/icons/deactivate.svg
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg id="svg2528" xmlns="http://www.w3.org/2000/svg" height="16" width="16" version="1.0" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs id="defs2530">
<linearGradient id="linearGradient2406" y2="5.4676" gradientUnits="userSpaceOnUse" x2="63.397" gradientTransform="matrix(.74324 0 0 .74322 -38.23 10.609)" y1="-12.489" x1="63.397">
<stop id="stop4875" style="stop-color:#fff" offset="0"/>
<stop id="stop4877" style="stop-color:#fff;stop-opacity:0" offset="1"/>
</linearGradient>
<linearGradient id="linearGradient2411" y2="3.0816" gradientUnits="userSpaceOnUse" x2="18.379" gradientTransform="matrix(.36857 0 0 .36857 -.84577 -.84577)" y1="44.98" x1="18.379">
<stop id="stop2492" style="stop-color:#791235" offset="0"/>
<stop id="stop2494" style="stop-color:#dd3b27" offset="1"/>
</linearGradient>
<radialGradient id="radialGradient2409" gradientUnits="userSpaceOnUse" cy="3.99" cx="23.896" gradientTransform="matrix(0 .87966 -1.1611 0 12.633 -21.084)" r="20.397">
<stop id="stop3244" style="stop-color:#f8b17e" offset="0"/>
<stop id="stop3246" style="stop-color:#e35d4f" offset=".26238"/>
<stop id="stop3248" style="stop-color:#c6262e" offset=".66094"/>
<stop id="stop3250" style="stop-color:#690b54" offset="1"/>
</radialGradient>
</defs>
<g id="layer1">
<g id="g2552">
<path id="path2555" style="stroke-linejoin:round;stroke:url(#linearGradient2411);stroke-linecap:round;stroke-width:1.0037;fill:url(#radialGradient2409)" d="m8 0.50183c-4.1372 0-7.4982 3.361-7.4982 7.4982 0.00003 4.137 3.361 7.498 7.4982 7.498 4.137 0 7.498-3.361 7.498-7.498 0-4.1372-3.361-7.4982-7.498-7.4982z"/>
<path id="path2463" style="opacity:.4;stroke:url(#linearGradient2406);fill:none" d="m14.5 7.9998c0 3.5902-2.91 6.5002-6.4999 6.5002s-6.5001-2.91-6.5001-6.5002c0-3.5898 2.9102-6.4998 6.5001-6.4998s6.4999 2.91 6.4999 6.4998z"/>
</g>
<path id="path3243" style="opacity:.2;fill-rule:evenodd" d="m5.2625 3l-1.2625 1.2625 2.6047 2.5913c0.08 0.081 0.08 0.2114 0 0.2924l-2.6047 2.5913 1.2625 1.2625 2.5913-2.5914c0.081-0.08 0.2114-0.08 0.2924 0l2.5918 2.5914 1.262-1.2625-2.5914-2.5913c-0.08-0.081-0.08-0.2114 0-0.2924l2.5914-2.5913-1.262-1.2625-2.5918 2.5914c-0.081 0.08-0.2114 0.08-0.2924 0l-2.5913-2.5914z"/>
<path id="path3256" style="fill:#fff;fill-rule:evenodd" d="m5.2625 4l-1.2625 1.2625 2.6047 2.5913c0.08 0.081 0.08 0.2114 0 0.2924l-2.6047 2.5918 1.2625 1.262 2.5913-2.5914c0.081-0.08 0.2114-0.08 0.2924 0l2.5918 2.5914 1.262-1.262-2.5914-2.5918c-0.08-0.081-0.08-0.2114 0-0.2924l2.5914-2.5913-1.262-1.2625-2.5918 2.5914c-0.081 0.08-0.2114 0.08-0.2924 0l-2.5913-2.5914z"/>
</g>
</svg>
freenetis/branches/testing/media/images/icons/activate.svg
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg id="svg2395" xmlns="http://www.w3.org/2000/svg" height="16" width="16" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs id="defs2397">
<linearGradient id="linearGradient2427" y2="31.138" gradientUnits="userSpaceOnUse" x2="-93.088" gradientTransform="matrix(.42104 -.10139 .10080 .42350 44.055 -5.0894)" y1="2.0691" x1="-86.129">
<stop id="stop2266" style="stop-color:#d7e866" offset="0"/>
<stop id="stop2268" style="stop-color:#8cab2a" offset="1"/>
</linearGradient>
<linearGradient id="linearGradient2431" y2="39.78" gradientUnits="userSpaceOnUse" x2="20.494" gradientTransform="matrix(.41388 0 0 .41629 -1.7222 -1.7776)" y1="7.044" x1="20.494">
<stop id="stop3402" style="stop-color:#fff" offset="0"/>
<stop id="stop3404" style="stop-color:#fff;stop-opacity:0" offset="1"/>
</linearGradient>
</defs>
<g id="layer1">
<path id="path1542" style="stroke-linejoin:round;stroke:#699536;stroke-linecap:round;stroke-width:1.0028;fill:url(#linearGradient2427)" d="m12.262 0.50446c-0.232-0.02365-0.462 0.09048-0.581 0.30958l-5.0718 9.333-3.2606-2.6075c-0.2904-0.1597-0.6528-0.057-0.8115 0.2352l-1.4622 1.8882c-0.1587 0.29213-0.051938 0.6565 0.2385 0.81613 0 0 5.9534 4.9457 5.9608 4.9493 0.068071 0.03741 0.13926 0.05624 0.21162 0.06544 0.23638 0.03004 0.47828-0.08166 0.59979-0.30532l6.8394-12.586c0.1587-0.29213 0.05194-0.6565-0.2385-0.81613l-2.194-1.2118c-0.073-0.03986-0.153-0.06176-0.23-0.06964z"/>
<path id="path2429" style="opacity:.4;stroke:url(#linearGradient2431);stroke-linecap:round;stroke-width:1.0028;fill:none" d="m12.312 1.6562-5.312 9.8128a0.15035 0.15035 0 0 1 0 0.031 0.15035 0.15035 0 0 1 -0.03125 0.03125 0.15035 0.15035 0 0 1 -0.03125 0 0.15035 0.15035 0 0 1 -0.03125 0.03125 0.15035 0.15035 0 0 1 -0.03125 0 0.15035 0.15035 0 0 1 -0.03125 0 0.15035 0.15035 0 0 1 -0.03125 -0.03125 0.15035 0.15035 0 0 1 -0.03125 0l-3.6562-2.906c-0.32388 0.40246-0.60092 0.77792-0.96875 1.25 0.1123 0.093077 1.303 1.09 2.625 2.1875 0.6912 0.57379 1.3815 1.1568 1.9062 1.5938 0.26235 0.21848 0.4994 0.39983 0.65625 0.53125 0.050142 0.04201 0.088455 0.06296 0.125 0.09375 0.052555-0.09355 0.10901-0.18055 0.25-0.4375 0.19196-0.34986 0.43971-0.83698 0.75-1.4062 0.62059-1.1385 1.4445-2.6103 2.25-4.0938 0.80552-1.4834 1.5812-2.9751 2.1875-4.0938 0.30316-0.55933 0.56868-1.0087 0.75-1.3438 0.14198-0.26236 0.21072-0.36449 0.25-0.4375-0.055-0.0314-0.1-0.0615-0.218-0.125-0.172-0.0919-0.379-0.1999-0.594-0.3126-0.215-0.1126-0.432-0.2271-0.594-0.3124-0.067-0.0354-0.141-0.0375-0.188-0.0626z"/>
</g>
</svg>
freenetis/branches/testing/media/css/style.css
#filter_form .submit {
float: left;
padding: 3px;
background-image: url('../images/icons/activate.svg');
background-image: url('../images/icons/activate.png');
background-repeat: no-repeat;
background-position: 3px 5px;
}
......
.ui-dialog-content {
padding: 20px !important;
}
.monitor-down {
background-color: red;
color: white !important;
}
.monitor-down a {
color: white !important;
}
freenetis/branches/testing/application/i18n/cs_CZ/texts.php
'autocomplete of gps coords' => 'Automatické doplnění GPS souřadnic',
'automatically fill in gps coordinates' => 'Automaticky doplnit GPS souřadnice',
'automatically import admins' => 'Automaticky přidat správce oblastí',
'availability' => 'Dostupnost',
'average' => 'Průměr',
'avarage day download' => 'Průměrný denní download',
'avarage day download' => 'Průměrný denní download',
'avarage day upload' => 'Průměrný denní upload',
'average latency' => 'Průměrná odezva',
'axo count' => 'Počet AXO',
'back' => 'Zpět',
'back to account transfers' => 'Zpět na převody účtu',
......
'currency' => 'Měna',
'current application password is' => 'Současné aplikační heslo je',
'current credit' => 'Současný kredit',
'current latency' => 'Aktuální odezva',
'current prices for voip calls' => 'Aktuální cena VoIP hovorů',
'current state' => 'Aktuální stav',
'currently clean urls are turn off' => 'V současné době jsou čistá URL vypnuta.',
'czk' => 'Kč',
'daily' => 'denně',
......
'device detail' => 'Detail zařízení',
'device fees have been successfully deducted, %d new transfers created' => 'Splátky zařízení byly úspěšně strženy, vytvořeno %d nových převodů.',
'device has been successfully deleted' => 'Zařízení bylo úspěšně smazáno.',
'device has been successfully removed from monitoring' => 'Zařízení bylo úspěšně odebráno z monitoringu.',
'device has been successfully saved' => 'Zařízení bylo úspěšně uloženo.',
'device has been successfully updated' => 'Zařízení bylo úspěšně upraveno.',
'device id' => 'ID zařízení',
......
'edit member' => 'Upravit člena',
'edit member limit' => 'Upravit limit člena',
'edit message' => 'Upravit zprávu',
'edit monitoring parameter of device' => 'Upravit parametry monitoringu zařízení',
'edit own records' => 'Upravovat vlastní záznamy',
'edit phone operator' => 'Upravit telefonního operátora',
'edit port' => 'Úprava portu',
......
'enable automatic fio import' => 'Povolit automatický import Fio',
'enable integrity test (all numbers in invoice has to be in extended statement)' => 'Povolit test na celistvost (každé číslo ve faktuře musí být v podrobném výpisu)',
'enable mysql event scheduler' => 'Povolit MySQL plánovač akcí',
'enable monitoring' => 'Povolit monitoring',
'enable qos' => 'Povolit QoS',
'enable this subnet' => 'Povolit tuto podsíť',
'enable ulogd' => 'Zapnout ulogd',
......
'error - cannot load intelligent selection' => 'Chyba - nelze načíst inteligentní výběr',
'error - cannot update message' => 'Chyba - nelze upravit zprávu.',
'error - cannot remove admin of cloud' => 'Chyba - nelze odebrat admina oblasti',
'error - cannot remove device from monitoring' => 'Chyba - nelze odstranit zařízení z monitoringu.',
'error - cannot save data' => 'Chyba - nelze uložit data.',
'error - cannot send email to applicant about approval of membership' => 'Chyba - nepodařilo se poslat email žadateli s vyhověním jeho žádosti o členství',
'error - cannot send email to applicant about deny of membership' => 'Chyba - nepodařilo se poslat email žadateli s nevyhověním jeho žádosti o členství',
......
'expiry time of registration' => 'Čas vypršení registrace',
'facility' => 'Služba',
'failed' => 'Selhání',
'failed polls' => 'Neúspěšných pokusů',
'fatal error' => 'Kritická chyba',
'february' => 'Únor',
'fee' => 'Poplatek',
......
'group has been successfully deleted' => 'Skupina byla úspěšně smazána.',
'group selection by same phone number' => 'Sdružovat výběry dle telefonních čísel',
'grouped works' => 'Shluklé práce',
'groups' => 'Skupiny',
'groups of users' => 'Skupiny uživatelů',
'growth of members' => 'Růst členů',
'have left' => 'Zbývá',
......
'ip address is required' => 'IP adresa je vyžadována.',
'ip address is successfully saved' => 'IP adresa byla úspěšně uložena.',
'ip address is successfully updated' => 'IP adresa byla úspěšně upravena.',
'ip address of monitoring server' => 'IP adresa monitorovacího serveru',
'ip addresses has been successfully deleted' => 'IP adresy byly úspěšně smazány',
'ip addresses list' => 'Seznam IP adres',
'ip addresses list of member' => 'Seznam IP adres člena',
'ip addresses' => 'IP adresy',
'ip_address' => 'IP adresa',
'is' => 'je',
'is again reachable' => 'je opět dostupný',
'is again reachable since' => 'je opět dostupný od',
'is empty' => 'je prázdný',
'it has been autocompleted %s gps coords' => 'Bylo automaticky doplněno %s GPS souřadnic.',
'is in' => 'je v',
'is not' => 'není',
'is not empty' => 'není prázdný',
'is not in' => 'není v',
'is unreachable' => 'je nedostupný',
'is unreachable since' => 'je nedostupný od',
'it can means that username/password/host are bad or host is unavailable' => 'To může znamenat, že uživatelské jméno/heslo/hostitel je špatné nebo je hostitel nedostupný.',
'it is not possible activate e-mail notification for this message' => 'Není možné aktivovat e-mail upozornění pro tuto zprávu.',
'it is not possible delete used template' => 'Není možné smazat použitou šablonu.',
......
'key has been successfully updated' => 'Klíč byl úspěšně aktualizován.',
'lack of credit' => 'Nedostatek kreditu',
'language' => 'Jazyk',
'last' => 'Poslední',
'last changed author' => 'Autor poslední úpravy',
'last changed date' => 'Datum poslední úpravy',
'last changed rev' => 'Revize poslední úpravy',
'last time login' => 'Poslední čas přihlášení',
'last update' => 'poslední aktualizace',
'latency' => 'Odezva',
'leaving date' => 'Datum vystoupení',
'leaving_date' => 'Datum vystoupení',
'length' => 'Délka',
......
'march' => 'Březen',
'mark all' => 'Označit vše',
'mark this invoice as filled in' => 'Označ tuto fakturu jako vyplněnou',
'maximal latency' => 'Maximální odezva',
'maximum count of allowed subnets' => 'Maximální počet povolených podsítí',
'may' => 'Květen',
'medium' => 'Médium',
......
'middle name' => 'Prostřední jméno',
'minimal duration is one month' => 'Minimální délka je jeden měsíc',
'minimal duration of interrupt is one month' => 'Minimální délka přerušení je jeden měsíc',
'minimal latency' => 'Minimální odezva',
'minimal suggest amount' => 'Minimální navrhovaná částka',
'minimum of traffic' => 'Minimální provoz',
'mode' => 'Mód',
'mode is required' => 'Mód je povinný.',
'monitor' => 'Sledovat',
'monitoring detail of device' => 'Detail monitoringu zařízení',
'monitoring error' => 'Monitoring chyba',
'monitoring has been successfully activated' => 'Monitoring byl úspěšně aktivován.',
'monitoring has been successfully deactivated' => 'Monitoring byl úspěšně deaktivován.',
'monitoring has been successfully updated' => 'Monitoring byl úspěšně aktualizován.',
'monitoring notice' => 'Monitoring oznámení',
'month' => 'Měsíc',
'month from' => 'Od měsíce (včetně)',
'monthly' => 'měsíčně',
......
'rejected work reports' => 'Zamítnuté prácovní výkazy',
'remove' => 'Odebrat',
'remove broadcast ip address' => 'Odebrat IP adresu broadcastu',
'remove device from monitoring' => 'Odebrat zařízení z monitoringu',
'remove items' => 'Odstranit položky',
'remove network ip address' => 'Odebrat IP adresu sítě',
'remove this work' => 'Odstranit tuto práci',
......
'send money to other account' => 'Poslat peníze na jiný účet',
'send sms' => 'Pošli SMS',
'send sms message' => 'Poslat SMS zprávu',
'send to e-mail address' => 'Odesílat na e-mailovou adresu',
'send to member' => 'Pošli členovi',
'send this concept for approval' => 'Zaslat tento koncept na hlasování o schválení',
'sender' => 'Odesílatel',
......
'show mail message' => 'Zobrazit poštovní zprávu',
'show member' => 'Zobrazit člena',
'show menu' => 'Zobrazit menu',
'show monitoring detail of device' => 'Zobrazit detail monitoringu zařízení',
'show more information about traffic of this member' => 'Zobrazit více informací o provozu tohoto člena',
'show parent for this message' => 'Zobrazit rodiče této zprávy',
'show redirection' => 'Zobrazit přesměrování',
......
'today traffic' => 'Dnešní provoz',
'too short' => 'Příliš krátké',
'tools' => 'Nástroje',
'top' => 'Nahoru',
'total' => 'Celkem',
'total count' => 'Celkový počet',
'total download' => 'Celkový download',
......
'total inbound' => 'Celkem příchozí',
'total items' => 'Celkem položek',
'total outbound' => 'Celkem odchozí',
'total polls' => 'Celkem pokusů',
'total price' => 'Celková cena',
'total speed' => 'Celková rychlost',
'total traffic' => 'Celkový provoz',
......
'um' => 'UZ',
'umark this invoice' => 'Odznačit fakturu',
'unallowed connecting place' => 'Nepovolené přípojné místo',
'unknown' => 'Neznámý',
'unread' => 'Nepřečtená',
'unsent' => 'Neodeslaná',
'until' => 'do',
......
'variable_symbol' => 'Variabilní symbol',
'variable symbol already exists in database' => 'Variabilní symbol už existuje v databázi.',
'variable symbol has not been found in the database' => 'Variabilní symbol nebyl nalezen v databázi.',
'variables for monitoring' => 'Proměnné pro monitoring',
'variables for qos' => 'Proměnné pro QoS',
'vat' => 'DPH',
'version' => 'verze',
freenetis/branches/testing/application/i18n/cs_CZ/help.php
'login_name' => 'Přihlašovací jméno do systému je nutné k přihlášení. Přihlašovací jmémo může obsahovat znaky anglické abecedy, čísla, těčku a podtržítko, minimální délka jména je 5 znaků.',
'mail_to_field' => 'Políčko bere jako vstup login uživatele, kterému chcete odeslat zprávu. Příjemců můžete uvést více, oddělte je čárkou.',
'member_name' => 'Vyplňujte v případě přidávání nějaké organizace. Pokud připojujete běžného člena, tak jako výsledné jméno člena se použije jeho jméno a příjmení.',
'monitoring_email_to' => 'E-mailová adresa, na kterou se budou odesílat informace z monitoringu.',
'monitoring_server_ip_address' => 'Jedná se o IP adresu počítače, na kterém běží skript freenetis-monitor. IP adresa se používá pro omezení přístupu na vstupní/výstupní data.',
'multiple_dropdown' => 'Více hodnot lze vybrat označení myší se stiknutou klávesou CTRL.',
'never_redirect' => 'Zapnete-li tuto volbu, pak nebude možné tuto IP adresu nikdy přesměrovat běžným přesměrováním. Toto je vhodné zejména pro významné partnery jako jsou úřady, školy atd.',
'other_subaccounts' => 'Ostatní podúčty jsou vlastně již všechny ostatní používané účty ve Freenetisu, které se vnitřně nijak nedělí. Jde například o účet přijatých členských příspěvků nebo pokladny a tak dále. Freenetis pochopitelně nevyužívá celou účetní osnovu ČR, vzhledem k charakteru občanského sdružení.',
freenetis/branches/testing/application/helpers/callback.php
}
/**
* Returns diff between field and current time
*
* @author Michal Kliment
* @param type $item
* @param type $name
* @param type $args
*/
public static function datetime_diff($item, $name, $args = array())
{
// return in array ('y' => years, 'm' => months, etc.)
$interval = date::interval(date('Y-m-d H:i:s'), $item->$name);
// don't print days
unset($interval['days']);
// remove all empty keys
while (current($interval) == 0)
{
array_shift($interval);
}
$units = array
(
'y' => 'year',
'm' => 'month',
'd' => 'day',
'h' => 'hour',
'i' => 'minute',
's' => 'second'
);
// short output?
$short = (isset($args[0]) && $args[0] == 'short');
$pieces = array();
foreach ($interval as $unit => $val)
{
// make plural (if needed) and translate
$unit = strtolower(__($units[$unit]. (($val > 1) ? 's' : '')));
// create short output (if needed)
if ($short)
$unit = substr($unit,0,1);
$pieces[] = $val.' '.$unit;
}
// return result
echo implode(', ',$pieces);
}
/**
* Callback for display GPS
*
* @author Ondřej Fibich
......
}
/**
* Callback print latency (from monitoring)
*
* @author Michal Kliment
* @param type $item
* @param type $name
*/
public static function latency_field ($item, $name)
{
$title = __('Last').": $item->latency_current ".__('ms')." \n"
.__('Minimum').": ".round($item->latency_min,2)." ".__('ms')."\n"
.__('Average').": ".round($item->latency_avg,2)." ".__('ms')."\n"
.__('Maximum').": ".round($item->latency_max,2)." ".__('ms')."\n";
$text = $item->latency_avg ? round($item->latency_avg,2).' '.__('ms') : '-';
echo "<span class='help' title='$title'>$text</span>";
}
/**
* Callback for action of log
*
* @author Ondřej Fibich
......
}
/**
* Callback to print host state (from monitoring)
*
* @author Michal Kliment
* @param type $item
* @param type $name
*/
public static function monitor_state_field($item, $name)
{
switch ($item->$name)
{
case Monitor_host_Model::STATE_UP:
$image = url::base().'media/images/states/active.png';
$title = __('Online');
break;
case Monitor_host_Model::STATE_DOWN:
$image = url::base().'media/images/states/inactive.png';
$title = __('Offline');
break;
case Monitor_host_Model::STATE_UNKNOWN:
$image = url::base().'media/images/states/inactive.png';
$title = __('Offline');
break;
}
echo html::image(array
(
'src' => $image,
'title' => $title,
'class' => 'monitor-state'
));
}
/**
* Callback function to print name of month
*
* @author Michal Kliment
freenetis/branches/testing/application/helpers/arr.php
return $array;
}
/**
* Returns key with maximal value from array
*
* @author Michal Kliment
* @param type $array
* @return type
*/
public static function max_key ($array)
{
return max(array_keys($array));
}
} // End arr
freenetis/branches/testing/application/helpers/text.php
return $str;
}
/**
* Handle printing of empty inputs
*
* @author Michal Kliment
* @param string $item
* @param boolean $print
* @param string $replace
* @param string $extra_text
* @return string
*/
public static function not_null($item, $print = FALSE, $replace = '???', $extra_text = '')
{
if ($item && $item != '')
return $item.' '.$extra_text;
if ($print)
{
return $replace.' '.$extra_text;
}
}
} // End text
freenetis/branches/testing/application/models/device.php
'device_type' => 'd.type',
'member_id' => 'users.member_id'
);
/**
* Gets all devices from database. Database query returns member's device parameters (id, name, type),
* owner of device (user name and surname), MAC addresses of interfaces, names of segments and ip addresses.
* @param $limit_from
* @param $limit_results
* @param $order_by
* @param $order_by_direction
* @param $member_id
* @return Mysql_Result
*/
public function get_all_devices($limit_from = 0, $limit_results = 50,
$order_by = 'device_id', $order_by_direction = 'ASC',
$user_id = null, $filter_sql = '')
{
* @param type $params
* @param type $user_id
* @return type
*/
public function get_all_devices($params = array(), $user_id = NULL)
{
// default params
$default_params = array
(
'order_by' => 'id',
'order_by_direction' => 'asc'
);
$params = array_merge($default_params, $params);
$conds = array();
// filter
if ($params['filter_sql'] != '')
$conds[] = $params['filter_sql'];
// user id
if ($user_id)
$conds[] = "d.user_id = " . intval($user_id);
$where = count($conds) ? 'WHERE '.implode(' AND ', $conds) : '';
// order by check
if (in_array($order_by, $this->arr_sql))
{
$order_by = $this->arr_sql[$order_by];
}
if (in_array($params['order_by'], $this->arr_sql))
$order_by = $this->arr_sql[$params['order_by']];
else
{
$order_by = $this->db->escape_column($order_by);
}
$order_by = $this->db->escape_column($params['order_by']);
// order by direction check
if (strtolower($order_by_direction) != 'desc')
{
if (strtolower($params['order_by_direction']) != 'desc')
$order_by_direction = 'asc';
}
$where = '';
// filter
else
$order_by_direction = 'desc';
if ($filter_sql != '')
$where = "WHERE $filter_sql";
if (isset($params['limit']) && isset($params['offset']))
$limit = "LIMIT " . intval($params['offset']) . ", " . intval($params['limit']);
else
$limit = "";
// user id
if (!empty($user_id))
{
if ($where == "")
$where .= "WHERE d.user_id = " . intval($user_id);
else
$where .= " AND d.user_id = " . intval($user_id);
}
// query
return $this->db->query("
SELECT * FROM
(
SELECT d.id AS device_id, d.type, IFNULL(f.translated_term, e.value) AS type_name,
d.name,
d.name AS device_name, u.id AS user_id,
SELECT d.id, d.id AS device_id, d.type,
IFNULL(f.translated_term, e.value) AS type_name,
d.name, d.name AS device_name, u.id AS user_id,
u.name AS user_name, u.surname AS user_surname, u.login AS user_login,
d.login, d.password, d.price, d.trade_name, d.payment_rate,
d.buy_date, m.name AS member_name, s.street, t.town,
......
) d
$where
ORDER BY $order_by $order_by_direction
LIMIT " . intval($limit_from) . ", " . intval($limit_results) . "
$limit
", Config::get('lang'));
die($this->db->last_query());
freenetis/branches/testing/application/models/email_queue.php
", Contact_Model::TYPE_EMAIL, Contact_Model::TYPE_EMAIL, self::STATE_OK)
->current()->total;
}
/**
* Adds message to the beginning of queue (will be send first)
*
* @author Michal Kliment
* @param type $from
* @param type $to
* @param type $subject
* @param type $body
* @return type
*/
public function push($from, $to, $subject, $body)
{
return $this->db->query("
INSERT INTO email_queues
SELECT
NULL, ?, ?, ?, ?, ?,
FROM_UNIXTIME(UNIX_TIMESTAMP(MIN(access_time))-1)
FROM email_queues
", array($from, $to, $subject, $body, self::STATE_NEW));
}
}
freenetis/branches/testing/application/models/monitor_host.php
<?php defined('SYSPATH') or die('No direct script access.');
/*
* This file is part of open source system FreeNetIS
* and it is release under GPLv3 licence.
*
* More info about licence can be found:
* http://www.gnu.org/licenses/gpl-3.0.html
*
* More info about project can be found:
* http://www.freenetis.org/
*
*/
/**
* Monitored hosts
*
* @package Model
*
* @property integer $id
* @property integer $device_id
* @property Device_Model $device
* @property integer $state
* @property integer $state_changed
* @property string $state_changed_date
* @property string $last_attempt_date
* @property string $last_notification_date
* @property float $latency_current
* @property float $latency_min
* @property float $latency_max
* @property float $latency_avg
* @property integer $polls_total
* @property integer $polls_failed
* @property float $availability
* @property integer $priority
*/
class Monitor_host_Model extends ORM
{
protected $belongs_to = array('device');
/**
* State of host is unknown
*/
const STATE_UNKNOWN = 0;
/**
* State of host is up
*/
const STATE_UP = 1;
/**
* State of host is down
*/
const STATE_DOWN = 2;
/**
* States which returns fping
*
* @var array
*/
private static $states = array
(
self::STATE_UP => 'alive',
self::STATE_DOWN => 'unreachable'
);
/**
* Human format of states
*
* @var array
*/
private static $labels = array
(
self::STATE_UP => 'online',
self::STATE_DOWN => 'offline',
self::STATE_UNKNOWN => 'unknown'
);
/**
* Color format of states
*
* @var array
*/
private static $colors = array
(
self::STATE_UP => 'green',
self::STATE_DOWN => 'red',
self::STATE_UNKNOWN => 'red'
);
/**
* Return state as number from string format
*
* @author Michal Kliment
* @param type $text
* @return type
*/
public static function get_state($text)
{
if (($key = arr::search($text, self::$states)) !== FALSE)
return $key;
else
return self::STATE_UNKNOWN;
}
/**
* Return state as label from number format
*
* @author Michal Kliment
* @param type $state
* @return boolean
*/
public static function get_label($state)
{
if (isset(self::$labels[$state]))
return __(self::$labels[$state]);
else
return FALSE;
}
/**
* Return state as color from number format
*
* @author Michal Kliment
* @param type $state
* @return boolean
*/
public static function get_color($state)
{
if (isset(self::$colors[$state]))
return __(self::$colors[$state]);
else
return FALSE;
}
/**
* Return all monitored hosts
*
* @author Michal Kliment
* @param type $priority
* @param string $order_by
* @param type $filter_sql
* @return type
*/
public function get_all_monitored_hosts(
$priority = NULL, $order_by = NULL, $filter_sql = '')
{
$where = '';
// return only hosts with given priority
if ($priority)
$where = 'WHERE priority = '.intval($priority);
// filter
if ($filter_sql != '')
$where = ($where != '') ? $where.' AND '. $filter_sql : 'WHERE '.$filter_sql;
// default order by host's ip address
if (!$order_by)
$order_by = 'INET_ATON(ip_address)';
return $this->db->query("
SELECT mh.*, GROUP_CONCAT(ip_address SEPARATOR '\n') AS ip_addresses
FROM
(
SELECT
mh.*, d.name AS device_name,
ip_address, ip_address_id,
CONCAT(
IF(
ap.name IS NOT NULL AND ap.name <> '', CONCAT(ap.name,' ('), ''
),
IF(
s.street IS NOT NULL, CONCAT(s.street, ' '), ''
),
IF(
ap.street_number IS NOT NULL, CONCAT(ap.street_number,', '), ''
),
t.town,
IF(
t.quarter IS NOT NULL, CONCAT('-',t.quarter), ''
),
', ',
t.zip_code,
IF(
ap.gps IS NOT NULL AND ap.gps <>'', CONCAT(', GPS ', X(ap.gps),'″N ',Y(ap.gps),'″E'), ''
),
IF(
ap.name IS NOT NULL AND ap.name <> '', ')', ''
)
) AS address_point_name, ap.town_id,
CONCAT(
t.town,
IF(
t.quarter <> '', CONCAT('-',t.quarter), ''
),
', ',
t.zip_code
) AS town_name,
IFNULL(tr.translated_term, et.value) AS type_name,
u.member_id, m.name AS member_name,
IF(state <> ?, IF(state <> ?, ?, ?), ?) AS state_name,
0 AS host_id
FROM devices d
LEFT JOIN
(
(SELECT service, ip_address, ip.id AS ip_address_id,
i1.device_id AS device_id
FROM ip_addresses ip
JOIN ifaces i1 ON ip.iface_id = i1.id
) UNION (
SELECT service, ip_address, ip.id AS ip_address_id,
i2.device_id AS device_id
FROM ip_addresses ip
JOIN vlan_ifaces vi ON ip.vlan_iface_id = vi.id
JOIN ifaces i2 ON vi.iface_id = i2.id)
) ip ON ip.device_id = d.id
JOIN monitor_hosts mh ON mh.device_id = d.id
LEFT JOIN address_points ap ON d.address_point_id = ap.id
LEFT JOIN towns t ON ap.town_id = t.id
LEFT JOIN streets s ON ap.street_id = s.id
LEFT JOIN enum_types et ON d.type = et.id
LEFT JOIN translations tr ON et.value = tr.original_term AND lang = 'cs'
LEFT JOIN users u ON d.user_id = u.id
LEFT JOIN members m ON u.member_id = m.id
ORDER BY service DESC, INET_ATON(ip_address)
) mh
$where
GROUP BY mh.device_id
ORDER BY $order_by
", array(self::STATE_UNKNOWN, self::STATE_UP, __('Offline'), __('Online'), __('Unknown')));
die(debug::printr($this->db->last_query()));
}
/**
* Return all hosts by given state, optional by interval in which have to
* be state changed date
*
* @author Michal Kliment
* @param type $state
* @param type $from_state_changed_diff
* @param type $to_state_changed_diff
* @return type
*/
public function get_all_hosts_by_state(
$state, $from_state_changed_diff = NULL, $to_state_changed_diff = NULL)
{
$where = '';
// limit results by interval of state changed date
if ($from_state_changed_diff !== NULL && $to_state_changed_diff !== NULL)
{
$where = 'WHERE state_changed_diff >= '.intval($from_state_changed_diff)
.' AND state_changed_diff <= '.intval($to_state_changed_diff)
.' AND (last_notification_diff IS NULL OR last_notification_diff > '
.(intval($to_state_changed_diff) - intval($from_state_changed_diff)).')';
}
return $this->db->query("
SELECT * FROM
(
SELECT
mh.*,
d.name,
ip_address,
CEIL(
(
UNIX_TIMESTAMP(last_attempt_date)
- UNIX_TIMESTAMP(state_changed_date)
)/60
) AS state_changed_diff,
CEIL(
(
UNIX_TIMESTAMP(last_attempt_date)
- UNIX_TIMESTAMP(last_notification_date)
)/60
) AS last_notification_diff
FROM monitor_hosts mh
LEFT JOIN devices d ON mh.device_id = d.id
LEFT JOIN
(
SELECT ip_address, ip.id AS ip_address_id,
IFNULL(i1.device_id, i2.device_id) AS device_id
FROM ip_addresses ip
LEFT JOIN ifaces i1 ON ip.iface_id = i1.id
LEFT JOIN vlan_ifaces vi ON ip.vlan_iface_id = vi.id
LEFT JOIN ifaces i2 ON vi.iface_id = i2.id
ORDER BY ip.service = 1 DESC
) ip ON ip.device_id = d.id
WHERE state = ?
GROUP BY d.id
) h
$where
ORDER BY state_changed_diff
", array($state));
}
/**
* Return maximum diff between state changed date and last attempt date
*
* @author Michal Kliment
* @param type $state
* @return type
*/
public function get_max_state_changed_diff($state)
{
return $this->db->query("
SELECT
MAX(CEIL(
(
UNIX_TIMESTAMP(last_attempt_date)
- UNIX_TIMESTAMP(state_changed_date)
)/60
)) AS state_changed_diff
FROM monitor_hosts mh
WHERE state = ?
", array($state))->current()->state_changed_diff;
}
/**
* Return all priorities
*
* @author Michal Kliment
*/
public function get_all_priorities()
{
return $this->db->query("
SELECT priority AS id, priority
FROM monitor_hosts
GROUP BY priority
");
}
public function get_all_members_with_monitoring()
{
return $this->db->query("
SELECT * FROM monitor_hosts
");
}
/**
* Update host with data from fping
*
* @author Michal Kliment
* @param type $ip_address
* @param type $state
* @param null $latency
* @return type
*/
public function update_host($ip_address, $state, $latency)
{
$failed = ($state == self::STATE_UP) ? 0 : 1;
if ($state != self::STATE_UP)
$latency = NULL;
return $this->db->query("
UPDATE monitor_hosts mh,
(
SELECT
IFNULL(i1.device_id, i2.device_id) AS device_id
FROM ip_addresses ip
LEFT JOIN ifaces i1 ON ip.iface_id = i1.id
LEFT JOIN vlan_ifaces vi ON ip.vlan_iface_id = vi.id
LEFT JOIN ifaces i2 ON vi.iface_id = i2.id
WHERE ip_address = ?
) ip
SET
state = ?,
state_changed = IF(state <> ?, 1, 0),
state_changed_date = IF(state <> ?, NOW(), state_changed_date),
last_attempt_date = NOW(),
latency_current = ?,
latency_min = IF(? IS NOT NULL AND (latency_min IS NULL OR latency_min > ?), ?, latency_min),
latency_max = IF(? IS NOT NULL AND (latency_max IS NULL OR latency_max < ?), ?, latency_max),
latency_avg = (IFNULL(latency_avg,0) * (polls_total - polls_failed) + ?)/(polls_total + 1 - polls_failed - ?),
polls_total = polls_total + 1,
polls_failed = polls_failed + ?,
availability = ROUND((polls_total + 1 - polls_failed - ?)/(polls_total + 1)*100, 2)
WHERE ip.device_id = mh.device_id
", array
(
$ip_address,
$state,
$state,
$state,
$latency,
$latency, $latency, $latency,
$latency, $latency, $latency,
$latency, $failed,
$failed, $failed
));
}
/**
* Adds hosts to monitoring
*
* @author Michal Kliment
* @param type $ids
* @param type $priority
* @return type
*/
public function insert_hosts($ids = array(), $priority)
{
if (!count($ids))
return;
$rows = array();
foreach ($ids as $id)
{
$rows[] = '('.$this->db->escape($id).', '.$this->db->escape($priority).', NOW())';
}
return $this->db->query("
INSERT INTO monitor_hosts (device_id, priority, state_changed_date) VALUES
".implode(', ',$rows)
);
}
public function update_hosts($ids = array(), $priority)
{
if (!count($ids))
return;
return $this->db->query("
UPDATE monitor_hosts
SET priority = ?
WHERE device_id IN
(
".implode(', ', $ids)."
)
", $priority);
}
public function delete_hosts($ids = array(), $column = 'device_id')
{
if (!count($ids))
return;
if (!$this->has_column($column))
$column = 'device_id';
return $this->db->query("
DELETE FROM monitor_hosts
WHERE ".$this->db->escape_column($column)." IN
(
".implode(', ', $ids)."
)
");
}
public function update_host_notification_date ($monitor_host_id)
{
return $this->db->query("
UPDATE monitor_hosts
SET last_notification_date = NOW()
WHERE id = ?;
", $monitor_host_id);
}
}
?>
freenetis/branches/testing/application/controllers/web_interface.php
*/
class Web_interface_Controller extends Controller
{
const MEMBERS_QOS_PARENT = 1;
const MEMBERS_QOS_ORDINARY = 2;
const MEMBERS_QOS_ACTIVE = 3;
......
echo text::print_in_columns($data, $columns);
}
/**
* Prints all IP addresses of hosts to monitored
*
* @author Michal Kliment
* @param type $priority
*/
public function monitoring_hosts($priority = NULL)
{
if (!Settings::get('monitoring_enabled')
|| (server::remote_addr() != Settings::get('monitoring_server_ip_address')))
return;
$monitor_host_model = new Monitor_host_Model();
$hosts = $monitor_host_model->get_all_monitored_hosts($priority);
foreach ($hosts as $host)
{
echo $host->ip_address."\n";
}
}
/**
* Sets states of monitored hosts
*
* @author Michal Kliment
* @return type
*/
public function monitoring_states()
{
if (!Settings::get('monitoring_enabled')
|| (server::remote_addr() != Settings::get('monitoring_server_ip_address')))
return;
$ips = $this->input->post('ip');
$states = $this->input->post('state');
$lats = $this->input->post('lat');
$monitor_host_model = new Monitor_host_Model();
foreach ($ips as $i => $ip)
{
$monitor_host_model->update_host($ip, Monitor_host_Model::get_state($states[$i]), $lats[$i]);
}
}
}
freenetis/branches/testing/application/controllers/scheduler.php
* @package Controller
*/
class Scheduler_Controller extends Controller
{
{
/**
* Log scheduler error
*
......
// update local subnets
self::update_local_subnets();
// send notification from monitoring
self::monitoring_notification();
}
/**
......
Settings::set('local_subnets_update_last', time());
}
}
/**
* Send notification of down hosts or hosts which returned from down state
*
* @author Michal Kliment
*/
private static function monitoring_notification()
{
// prepare models
$email_queue_model = new Email_queue_Model();
$monitor_host_model = new Monitor_host_Model();
// find maximal diff between down time and last attempt time
$max_down_diff = $monitor_host_model
->get_max_state_changed_diff(Monitor_host_Model::STATE_DOWN);
/**
* following code generate sequence of diffs
* for each diff and host will be sent notification once time
*/
$diffs = array();
$increase = 3;
$growth = 5;
$i = 0;
$max = 5;
while ($i <= $max_down_diff)
{
$diffs[] = $i;
$i += $increase;
if ($i >= $max)
{
$increase = $max;
$max *= $growth;
}
}
// maximal value from sequence of diff for which will sent notification
// about hosts which returned from down state
$max_returned_diff = 10;
for($i=0;$i<count($diffs)-1;$i++)
{
/**
* find all down hosts in interval between this diff and next diff
* (exclude hosts about which has been already sent notification
* in this interval)
*/
$down_hosts = $monitor_host_model->get_all_hosts_by_state(
Monitor_host_Model::STATE_DOWN, $diffs[$i], $diffs[$i+1]);
// for each send e-mail
foreach ($down_hosts as $down_host)
{
$email_queue_model->push(
Settings::get('email_default_email'),
Settings::get('monitoring_email_to'),
__('Monitoring error').': '.__('Host').' '.$down_host->name.' '.__('is unreachable'),
__('Host').' '
.html::anchor(url_lang::base().'devices/show/'.$down_host->device_id, $down_host->name)
.' '.__('is unreachable since').' '.strftime("%c", strtotime($down_host->state_changed_date))
);
$monitor_host_model->update_host_notification_date($down_host->id);
}
// send notification about hosts which returned from down state
if ($diffs[$i] < $max_returned_diff)
{
/**
* find all hosts which returned from down state in interval
* between this diff and next diff (exclude hosts about which
* has been already sent notification in this interval)
*/
$returned_hosts = $monitor_host_model->get_all_hosts_by_state(
Monitor_host_Model::STATE_UP, $diffs[$i], $diffs[$i+1]);
// for each send e-mail
foreach ($returned_hosts as $returned_host)
{
$email_queue_model->push(
Settings::get('email_default_email'),
Settings::get('monitoring_email_to'),
__('Monitoring notice').': '.__('Host').' '.$returned_host->name.' '.__('is again reachable'),
__('Host').' '
.html::anchor(url_lang::base().'devices/show/'.$returned_host->device_id, $returned_host->name)
.' '.__('is again reachable since').' '.strftime("%c", strtotime($returned_host->state_changed_date))
);
$monitor_host_model->update_host_notification_date($returned_host->id);
}
}
}
}
}
freenetis/branches/testing/application/controllers/settings.php
'voip' => __('VoIP'),
'sms' => __('SMS'),
'logging' => __('Logging'),
'monitoring' => __('Monitoring'),
'registration_export' => __('Export of registration')
);
// because of ajax loading of tabs, see main view for explementation
......
$view->content->message = $message;
$view->render(TRUE);
}
/**
* Settings for monitoring
*
* @author Michal Kliment
*/
public function monitoring()
{
// access control
if (!$this->acl_check_edit('Settings_Controller', 'system'))
Controller::error(ACCESS);
// creating of new forge
$this->form = new Forge();
$this->form->group('Variables for monitoring');
$this->form->checkbox('monitoring_enabled')
->value('1')
->label(__('Enable monitoring'));
if (Settings::get('monitoring_enabled') == 1)
$this->form->monitoring_enabled->checked('checked');
$this->form->input('monitoring_server_ip_address')
->rules('valid_ip_address')
->value(Settings::get('monitoring_server_ip_address'))
->label('IP address of monitoring server')
->help('monitoring_server_ip_address');
$this->form->input('monitoring_email_to')
->rules('valid_email')
->value(Settings::get('monitoring_email_to'))
->label('Send to e-mail address')
->help('monitoring_email_to');
... Rozdílový soubor je zkrácen, protože jeho délka přesahuje max. limit.

Také k dispozici: Unified diff