better widescreen support
This commit is contained in:
@@ -620,7 +620,7 @@
|
|||||||
|
|
||||||
nodeHeight = ((emSize*100*0.30).toFixed(0))
|
nodeHeight = ((emSize*100*0.30).toFixed(0))
|
||||||
|
|
||||||
$("#networkTree").attr('style', "height:"+treeAreaHeight+"px; width:1070px")
|
$("#networkTree").attr('style', `height:${treeAreaHeight}px; width:${$('.content-header').width()}px`)
|
||||||
|
|
||||||
myTree = Treeviz.create({
|
myTree = Treeviz.create({
|
||||||
htmlId: "networkTree",
|
htmlId: "networkTree",
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ if ($ENABLED_DARKMODE === True) {
|
|||||||
|
|
||||||
<!-- ----------------------------------------------------------------------- -->
|
<!-- ----------------------------------------------------------------------- -->
|
||||||
<!-- Layout Boxed Yellow -->
|
<!-- Layout Boxed Yellow -->
|
||||||
<body class="hold-transition <?php echo $pia_skin_selected;?> layout-boxed sidebar-mini" <?php echo $BACKGROUND_IMAGE_PATCH;?> onLoad="show_pia_servertime();" >
|
<body class="hold-transition <?php echo $pia_skin_selected;?> sidebar-mini" <?php echo $BACKGROUND_IMAGE_PATCH;?> onLoad="show_pia_servertime();" >
|
||||||
<!-- Site wrapper -->
|
<!-- Site wrapper -->
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
|
|
||||||
|
|||||||
@@ -313,9 +313,13 @@ The UI will adjust how columns are displayed in the UI based on the definition o
|
|||||||
|
|
||||||
## Full Examples
|
## Full Examples
|
||||||
|
|
||||||
- Script based plugin: Check the [website_monitor (WEBMON) config.json](https://github.com/jokob-sk/Pi.Alert/blob/main/front/plugins/website_monitor/config.json) file for details.
|
### Script based plugins
|
||||||
- SQL query nased plugin: Check the [nmap_services (NMAPSERV) config.json](https://github.com/jokob-sk/Pi.Alert/blob/main/front/plugins/nmap_services/config.json) file for details.
|
|
||||||
|
|
||||||
|
- [website_monitor (WEBMON) config.json](https://github.com/jokob-sk/Pi.Alert/blob/main/front/plugins/website_monitor/config.json)
|
||||||
|
- [dhcp_servers (DHCPSRVS) config.json](https://github.com/jokob-sk/Pi.Alert/blob/main/front/plugins/dhcp_servers/config.json)
|
||||||
|
|
||||||
|
### SQL query based plugins
|
||||||
|
- [nmap_services (NMAPSERV) config.json](https://github.com/jokob-sk/Pi.Alert/blob/main/front/plugins/nmap_services/config.json)
|
||||||
|
|
||||||
### Screenshots
|
### Screenshots
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
A simple sample plugin allowing for monitoring web services or urls. The status code corresponds to the commonly used [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status).
|
A simple sample plugin allowing for detecting rogue DHCP servers on the network.
|
||||||
|
|
||||||
### Usage
|
### Usage
|
||||||
|
|
||||||
- The user can specify which services (websites) to monitor via the `WEBMON_urls_to_check` setting.
|
- No specific configuration needed.
|
||||||
|
|
||||||
### Notes
|
### Notes
|
||||||
|
|
||||||
- Setting `(WEBMON_)SQL_internet_ip` is not used and specified for demonstration purposes only.
|
- No specific configuration needed.
|
||||||
- Parameters `macs` and `internet_ip` in the `config.json` file are not used and specified for demonstration purposes only.
|
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# Based on the work of https://github.com/leiweibau/Pi.Alert
|
# Based on the work of https://github.com/leiweibau/Pi.Alert
|
||||||
|
|
||||||
# /home/pi/pialert/front/plugins/website_monitor/script.py urls=http://google.com,http://bing.com
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
from time import sleep, time, strftime
|
from time import sleep, time, strftime
|
||||||
import requests
|
import requests
|
||||||
@@ -9,14 +8,10 @@ import pathlib
|
|||||||
import threading
|
import threading
|
||||||
import subprocess
|
import subprocess
|
||||||
import socket
|
import socket
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import io
|
import io
|
||||||
#import smtplib
|
|
||||||
import sys
|
import sys
|
||||||
#from smtp_config import sender, password, receivers, host, port
|
|
||||||
from requests.packages.urllib3.exceptions import InsecureRequestWarning
|
from requests.packages.urllib3.exceptions import InsecureRequestWarning
|
||||||
|
|
||||||
import pwd
|
import pwd
|
||||||
import os
|
import os
|
||||||
|
|
||||||
@@ -43,10 +38,6 @@ def main():
|
|||||||
#dhcp_server_list_time = []
|
#dhcp_server_list_time = []
|
||||||
for _ in range(dhcp_probes):
|
for _ in range(dhcp_probes):
|
||||||
output = subprocess.check_output (nmapArgs, universal_newlines=True, stderr=subprocess.STDOUT, timeout=(timeoutSec ))
|
output = subprocess.check_output (nmapArgs, universal_newlines=True, stderr=subprocess.STDOUT, timeout=(timeoutSec ))
|
||||||
# stream = os.popen('sudo nmap --script broadcast-dhcp-discover 2>/dev/null')
|
|
||||||
# output = stream.read()
|
|
||||||
# last_run_logfile.write(output)
|
|
||||||
|
|
||||||
newLines = newLines + output.split("\n")
|
newLines = newLines + output.split("\n")
|
||||||
|
|
||||||
# parse output
|
# parse output
|
||||||
@@ -61,13 +52,9 @@ def main():
|
|||||||
index = len(newEntries) - 1
|
index = len(newEntries) - 1
|
||||||
|
|
||||||
if 'Response ' in line and ' of ' in line:
|
if 'Response ' in line and ' of ' in line:
|
||||||
|
|
||||||
newEntries.append(plugin_object_class())
|
newEntries.append(plugin_object_class())
|
||||||
|
|
||||||
elif 'Server Identifier' in line :
|
elif 'Server Identifier' in line :
|
||||||
newEntries[index].primaryId = line.split(':')[1].strip()
|
newEntries[index].primaryId = line.split(':')[1].strip()
|
||||||
|
|
||||||
|
|
||||||
elif 'Domain Name' in line :
|
elif 'Domain Name' in line :
|
||||||
newEntries[index].secondaryId = line.split(':')[1].strip()
|
newEntries[index].secondaryId = line.split(':')[1].strip()
|
||||||
elif 'Domain Name Server' in line :
|
elif 'Domain Name Server' in line :
|
||||||
@@ -82,10 +69,8 @@ def main():
|
|||||||
elif ('IP Address Lease Time' in line or 'Subnet Mask' in line or 'Broadcast Address' in line) :
|
elif ('IP Address Lease Time' in line or 'Subnet Mask' in line or 'Broadcast Address' in line) :
|
||||||
newEntries[index].extra = newEntries[index].extra + ',' + line.split(':')[1].strip()
|
newEntries[index].extra = newEntries[index].extra + ',' + line.split(':')[1].strip()
|
||||||
|
|
||||||
|
|
||||||
for e in newEntries:
|
for e in newEntries:
|
||||||
# Insert list into the log
|
# Insert list into the log
|
||||||
|
|
||||||
service_monitoring_log(e.primaryId, e.secondaryId, e.created, e.watched1, e.watched2, e.watched3, e.watched4, e.extra, e.foreignKey )
|
service_monitoring_log(e.primaryId, e.secondaryId, e.created, e.watched1, e.watched2, e.watched3, e.watched4, e.extra, e.foreignKey )
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user