WIP
parent
96356c047c
commit
81c78502bb
|
@ -14,14 +14,14 @@ namespace ln.skyscanner.crawl.tests
|
||||||
{
|
{
|
||||||
public class ICMP : CrawlService
|
public class ICMP : CrawlService
|
||||||
{
|
{
|
||||||
|
public Ping Ping { get; private set; }
|
||||||
|
|
||||||
public ICMP()
|
public ICMP()
|
||||||
:base("ping")
|
:base("ping")
|
||||||
{}
|
{}
|
||||||
|
|
||||||
public override bool Check(Crawl crawl)
|
public override bool Check(Crawl crawl)
|
||||||
{
|
{
|
||||||
using (Ping ping = new Ping())
|
|
||||||
{
|
|
||||||
int nSuccess = 0;
|
int nSuccess = 0;
|
||||||
long roundTripTime = 0;
|
long roundTripTime = 0;
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ namespace ln.skyscanner.crawl.tests
|
||||||
{
|
{
|
||||||
//HostCrawl.setState("ICMP check [{0}/10]", n);
|
//HostCrawl.setState("ICMP check [{0}/10]", n);
|
||||||
|
|
||||||
PingReply pingReply = ping.Send(crawl.Host.PrimaryIP, 500);
|
PingReply pingReply = Ping.Send(crawl.Host.PrimaryIP, 500);
|
||||||
if (pingReply.Status == IPStatus.Success)
|
if (pingReply.Status == IPStatus.Success)
|
||||||
{
|
{
|
||||||
nSuccess++;
|
nSuccess++;
|
||||||
|
@ -59,7 +59,6 @@ namespace ln.skyscanner.crawl.tests
|
||||||
crawl.Host.SetHint("ping.rta", null);
|
crawl.Host.SetHint("ping.rta", null);
|
||||||
crawl.Host.SetHint("ping.out_of_ten", 0);
|
crawl.Host.SetHint("ping.out_of_ten", 0);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
using System;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
namespace ln.skyscanner.entities
|
||||||
|
{
|
||||||
|
[JsonConverter(typeof(StringEnumConverter))]
|
||||||
|
public enum DeviceType
|
||||||
|
{
|
||||||
|
UNKNOWN,
|
||||||
|
ROUTER,
|
||||||
|
PTP,
|
||||||
|
PTMP,
|
||||||
|
UPS,
|
||||||
|
SERVER
|
||||||
|
}
|
||||||
|
}
|
|
@ -268,10 +268,10 @@ namespace ln.skyscanner.entities
|
||||||
if (httpIndex.Contains("<title>B5c</title>"))
|
if (httpIndex.Contains("<title>B5c</title>"))
|
||||||
{
|
{
|
||||||
node.Product = "B5c";
|
node.Product = "B5c";
|
||||||
|
node.DeviceType = DeviceType.PTP;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (crawledHost.GetHint("http.server", "").Equals("Viprinet"))
|
if (crawledHost.GetHint("http.server", "").Equals("Viprinet"))
|
||||||
node.Vendor = "Viprinet";
|
node.Vendor = "Viprinet";
|
||||||
|
|
||||||
|
@ -280,6 +280,12 @@ namespace ln.skyscanner.entities
|
||||||
node.Vendor = "Ubiquity";
|
node.Vendor = "Ubiquity";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (crawledHost.GetHint<bool>("ubiquity.ptp",false))
|
||||||
|
{
|
||||||
|
node.DeviceType = DeviceType.PTP;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
foreach (Network4 network in node.Networks)
|
foreach (Network4 network in node.Networks)
|
||||||
EnsureSubnet(network);
|
EnsureSubnet(network);
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,8 @@ namespace ln.skyscanner.entities
|
||||||
public string ProductLine { get; set; }
|
public string ProductLine { get; set; }
|
||||||
public CheckSeverity Severity { get; set; } = CheckSeverity.PLANNED;
|
public CheckSeverity Severity { get; set; } = CheckSeverity.PLANNED;
|
||||||
|
|
||||||
|
public DeviceType DeviceType { get; set; }
|
||||||
|
|
||||||
public List<NetworkInterface> Interfaces { get; private set; } = new List<NetworkInterface>();
|
public List<NetworkInterface> Interfaces { get; private set; } = new List<NetworkInterface>();
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
|
|
|
@ -80,6 +80,7 @@
|
||||||
<Compile Include="checks\SkyCheckState.cs" />
|
<Compile Include="checks\SkyCheckState.cs" />
|
||||||
<Compile Include="entities\PointOfPresence.cs" />
|
<Compile Include="entities\PointOfPresence.cs" />
|
||||||
<Compile Include="entities\CheckSeverity.cs" />
|
<Compile Include="entities\CheckSeverity.cs" />
|
||||||
|
<Compile Include="entities\DeviceType.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="packages.config" />
|
<None Include="packages.config" />
|
||||||
|
@ -95,12 +96,6 @@
|
||||||
<None Include="templates\static\workspace.js">
|
<None Include="templates\static\workspace.js">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
<None Include="templates\static\summary.html">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</None>
|
|
||||||
<None Include="templates\static\crawlerhosts.html">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</None>
|
|
||||||
<None Include="templates\static\tables.js">
|
<None Include="templates\static\tables.js">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
|
@ -138,9 +133,6 @@
|
||||||
<None Include="templates\static\css\datatables.min.css">
|
<None Include="templates\static\css\datatables.min.css">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
<None Include="templates\static\crawlersubnets.html">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</None>
|
|
||||||
<None Include="templates\static\dist\percentageBars.js">
|
<None Include="templates\static\dist\percentageBars.js">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
|
@ -199,6 +191,15 @@
|
||||||
<None Include="templates\static\checks\issues.html">
|
<None Include="templates\static\checks\issues.html">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
|
<None Include="templates\static\crawler\hosts.html">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
<None Include="templates\static\crawler\subnets.html">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
<None Include="templates\static\crawler\status.html">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="identify\" />
|
<Folder Include="identify\" />
|
||||||
|
@ -215,6 +216,7 @@
|
||||||
<Folder Include="http\check\" />
|
<Folder Include="http\check\" />
|
||||||
<Folder Include="templates\static\checks\" />
|
<Folder Include="templates\static\checks\" />
|
||||||
<Folder Include="templates\static\system\" />
|
<Folder Include="templates\static\system\" />
|
||||||
|
<Folder Include="templates\static\crawler\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\ln.snmp\ln.snmp.csproj">
|
<ProjectReference Include="..\ln.snmp\ln.snmp.csproj">
|
||||||
|
|
|
@ -1,33 +1,6 @@
|
||||||
<%frame "frame.html"%>
|
<%frame "frame.html"%>
|
||||||
<div>
|
<div>
|
||||||
<h1>Übersicht</h1>
|
<h1>Crawler Status</h1>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<table style="width: 60%;">
|
|
||||||
<tr>
|
|
||||||
<td>System</td>
|
|
||||||
<td></td>
|
|
||||||
<td style="width: 100px;"></td>
|
|
||||||
<td style="width: 100px;"><button onclick="skyapi().call('api/management','Shutdown')">Shutdown</button></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Crawler</td>
|
|
||||||
<td></td>
|
|
||||||
<td style="width: 100px;"><button onclick="skyapi().call('api/management','StartCrawler')">Start</button></td>
|
|
||||||
<td style="width: 100px;"><button onclick="skyapi().call('api/management','StopCrawler')">Stop</button></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td></td>
|
|
||||||
<td></td>
|
|
||||||
<td style="width: 100px;"><input type="checkbox" id="cbCrawlHosts"/><label for="cbCrawlHosts">Hosts</label></td>
|
|
||||||
<td style="width: 100px;"><input type="checkbox" id="cbCrawlSubnets"/><label for="cbCrawlSubnets">Subnets</label></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<h1>Crawler</h1>
|
|
||||||
<div class="flex column">
|
<div class="flex column">
|
||||||
<div>
|
<div>
|
||||||
<h2><a href="#" onclick="refreshCrawlerTables(); return false;">Current Jobs</a></h2>
|
<h2><a href="#" onclick="refreshCrawlerTables(); return false;">Current Jobs</a></h2>
|
||||||
|
@ -97,28 +70,6 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$("#cbCrawlHosts").on("click", function(){ skyapi().call("api/crawler","ToggleCrawlHosts"); } );
|
|
||||||
$("#cbCrawlSubnets").on("click", function(){ skyapi().call("api/crawler","ToggleCrawlSubnets"); } );
|
|
||||||
|
|
||||||
createCrawlerTables();
|
createCrawlerTables();
|
||||||
skyapi().addRefresh(refreshCrawlerTables, 1);
|
skyapi().addRefresh(refreshCrawlerTables, 1);
|
||||||
skyapi().addRefresh(
|
|
||||||
function(){
|
|
||||||
skyapi().call(
|
|
||||||
"api/crawler",
|
|
||||||
"GetCrawlSubnets",
|
|
||||||
[],
|
|
||||||
function(r){
|
|
||||||
$("#cbCrawlSubnets").prop("checked", r);
|
|
||||||
} );
|
|
||||||
skyapi().call(
|
|
||||||
"api/crawler",
|
|
||||||
"GetCrawlHosts",
|
|
||||||
[],
|
|
||||||
function(r){
|
|
||||||
$("#cbCrawlHosts").prop("checked", r);
|
|
||||||
} );
|
|
||||||
},
|
|
||||||
1
|
|
||||||
);
|
|
||||||
</script>
|
</script>
|
|
@ -20,6 +20,14 @@
|
||||||
<label for="dVendor">Hersteller</label><input type="text" id="dVendor"><br>
|
<label for="dVendor">Hersteller</label><input type="text" id="dVendor"><br>
|
||||||
<label for="dProduct">Modell</label><input type="text" id="dProduct"><br>
|
<label for="dProduct">Modell</label><input type="text" id="dProduct"><br>
|
||||||
<label for="dProductLine">Modellzeile</label><input type="text" id="dProductLine"><br>
|
<label for="dProductLine">Modellzeile</label><input type="text" id="dProductLine"><br>
|
||||||
|
<label for="dDeviceType">Gerätetyp</label><select id="dDeviceType">
|
||||||
|
<option value="UNKNOWN">-</option>
|
||||||
|
<option value="ROUTER">Router</option>
|
||||||
|
<option value="PTP">PtP</option>
|
||||||
|
<option value="PTMP">PtmP</option>
|
||||||
|
<option value="UPS">USV</option>
|
||||||
|
<option value="SERVER">Server</option>
|
||||||
|
</select>
|
||||||
<label for="dLocation">Lokalisation</label><input type="text" id="dLocation"><br>
|
<label for="dLocation">Lokalisation</label><input type="text" id="dLocation"><br>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<fieldset id="dURIs">
|
<fieldset id="dURIs">
|
||||||
|
@ -49,6 +57,7 @@
|
||||||
|
|
||||||
$("#dURIs").empty();
|
$("#dURIs").empty();
|
||||||
$("#dInterfaces").empty();
|
$("#dInterfaces").empty();
|
||||||
|
$("#dDeviceType").prop("disabled",true).selectmenu().val("");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$("#dName").prop("disabled", false).val(node.Name);
|
$("#dName").prop("disabled", false).val(node.Name);
|
||||||
|
@ -72,12 +81,9 @@
|
||||||
$("#dInterfaces").append( $( "<option value='"+ this.Network +"'>" + this.IP + "[ " + intf.Name + " ]</option>" ) );
|
$("#dInterfaces").append( $( "<option value='"+ this.Network +"'>" + this.IP + "[ " + intf.Name + " ]</option>" ) );
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
/*
|
|
||||||
skyapi().call("api/network","GetNeighbors", [ node.ID ], function(neighbors){
|
$("#dDeviceType").prop("disabled",false).selectmenu().val(this.DeviceType);
|
||||||
$("#nodeTable").DataTable().clear().rows.add( neighbors ).draw();
|
|
||||||
});
|
|
||||||
*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,6 +103,7 @@
|
||||||
{ title: "Letztes Update", data: "LastUpdate" },
|
{ title: "Letztes Update", data: "LastUpdate" },
|
||||||
{ title: "Hersteller", data: "Vendor" },
|
{ title: "Hersteller", data: "Vendor" },
|
||||||
{ title: "Produkt", data: "Product" },
|
{ title: "Produkt", data: "Product" },
|
||||||
|
{ title: "Gerätetyp", data: "DeviceType" },
|
||||||
{ title: "Standort", data: "Location", render: function(d,t,r){ return d.Latitude + "/" + d.Longitude; } }
|
{ title: "Standort", data: "Location", render: function(d,t,r){ return d.Latitude + "/" + d.Longitude; } }
|
||||||
],
|
],
|
||||||
columnDefs: [
|
columnDefs: [
|
||||||
|
|
|
@ -25,3 +25,28 @@
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
$("#cbCrawlHosts").on("click", function(){ skyapi().call("api/crawler","ToggleCrawlHosts"); } );
|
||||||
|
$("#cbCrawlSubnets").on("click", function(){ skyapi().call("api/crawler","ToggleCrawlSubnets"); } );
|
||||||
|
|
||||||
|
skyapi().addRefresh(
|
||||||
|
function(){
|
||||||
|
skyapi().call(
|
||||||
|
"api/crawler",
|
||||||
|
"GetCrawlSubnets",
|
||||||
|
[],
|
||||||
|
function(r){
|
||||||
|
$("#cbCrawlSubnets").prop("checked", r);
|
||||||
|
} );
|
||||||
|
skyapi().call(
|
||||||
|
"api/crawler",
|
||||||
|
"GetCrawlHosts",
|
||||||
|
[],
|
||||||
|
function(r){
|
||||||
|
$("#cbCrawlHosts").prop("checked", r);
|
||||||
|
} );
|
||||||
|
},
|
||||||
|
1
|
||||||
|
);
|
||||||
|
</script>
|
||||||
|
|
|
@ -30,10 +30,13 @@
|
||||||
<div class="popup">Crawler
|
<div class="popup">Crawler
|
||||||
<div>
|
<div>
|
||||||
<div>
|
<div>
|
||||||
<a href="/static/crawlerhosts.html"><div>Hosts</div></a>
|
<a href="/static/crawler/status.html"><div>Status</div></a>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<a href="/static/crawlersubnets.html"><div>Subnets</div></a>
|
<a href="/static/crawler/hosts.html"><div>Hosts</div></a>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<a href="/static/crawler/subnets.html"><div>Subnets</div></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue