WIP
parent
96356c047c
commit
81c78502bb
|
@ -14,14 +14,14 @@ namespace ln.skyscanner.crawl.tests
|
|||
{
|
||||
public class ICMP : CrawlService
|
||||
{
|
||||
public Ping Ping { get; private set; }
|
||||
|
||||
public ICMP()
|
||||
:base("ping")
|
||||
{}
|
||||
|
||||
public override bool Check(Crawl crawl)
|
||||
{
|
||||
using (Ping ping = new Ping())
|
||||
{
|
||||
int nSuccess = 0;
|
||||
long roundTripTime = 0;
|
||||
|
||||
|
@ -29,7 +29,7 @@ namespace ln.skyscanner.crawl.tests
|
|||
{
|
||||
//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)
|
||||
{
|
||||
nSuccess++;
|
||||
|
@ -59,7 +59,6 @@ namespace ln.skyscanner.crawl.tests
|
|||
crawl.Host.SetHint("ping.rta", null);
|
||||
crawl.Host.SetHint("ping.out_of_ten", 0);
|
||||
}
|
||||
}
|
||||
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>"))
|
||||
{
|
||||
node.Product = "B5c";
|
||||
node.DeviceType = DeviceType.PTP;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (crawledHost.GetHint("http.server", "").Equals("Viprinet"))
|
||||
node.Vendor = "Viprinet";
|
||||
|
||||
|
@ -280,6 +280,12 @@ namespace ln.skyscanner.entities
|
|||
node.Vendor = "Ubiquity";
|
||||
}
|
||||
|
||||
if (crawledHost.GetHint<bool>("ubiquity.ptp",false))
|
||||
{
|
||||
node.DeviceType = DeviceType.PTP;
|
||||
}
|
||||
|
||||
|
||||
foreach (Network4 network in node.Networks)
|
||||
EnsureSubnet(network);
|
||||
|
||||
|
|
|
@ -40,6 +40,8 @@ namespace ln.skyscanner.entities
|
|||
public string ProductLine { get; set; }
|
||||
public CheckSeverity Severity { get; set; } = CheckSeverity.PLANNED;
|
||||
|
||||
public DeviceType DeviceType { get; set; }
|
||||
|
||||
public List<NetworkInterface> Interfaces { get; private set; } = new List<NetworkInterface>();
|
||||
|
||||
[JsonIgnore]
|
||||
|
|
|
@ -80,6 +80,7 @@
|
|||
<Compile Include="checks\SkyCheckState.cs" />
|
||||
<Compile Include="entities\PointOfPresence.cs" />
|
||||
<Compile Include="entities\CheckSeverity.cs" />
|
||||
<Compile Include="entities\DeviceType.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
|
@ -95,12 +96,6 @@
|
|||
<None Include="templates\static\workspace.js">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</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">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
|
@ -138,9 +133,6 @@
|
|||
<None Include="templates\static\css\datatables.min.css">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="templates\static\crawlersubnets.html">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="templates\static\dist\percentageBars.js">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
|
@ -199,6 +191,15 @@
|
|||
<None Include="templates\static\checks\issues.html">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</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>
|
||||
<Folder Include="identify\" />
|
||||
|
@ -215,6 +216,7 @@
|
|||
<Folder Include="http\check\" />
|
||||
<Folder Include="templates\static\checks\" />
|
||||
<Folder Include="templates\static\system\" />
|
||||
<Folder Include="templates\static\crawler\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\ln.snmp\ln.snmp.csproj">
|
||||
|
|
|
@ -1,33 +1,6 @@
|
|||
<%frame "frame.html"%>
|
||||
<div>
|
||||
<h1>Übersicht</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>
|
||||
<h1>Crawler Status</h1>
|
||||
<div class="flex column">
|
||||
<div>
|
||||
<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();
|
||||
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>
|
|
@ -20,6 +20,14 @@
|
|||
<label for="dVendor">Hersteller</label><input type="text" id="dVendor"><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="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>
|
||||
</fieldset>
|
||||
<fieldset id="dURIs">
|
||||
|
@ -49,6 +57,7 @@
|
|||
|
||||
$("#dURIs").empty();
|
||||
$("#dInterfaces").empty();
|
||||
$("#dDeviceType").prop("disabled",true).selectmenu().val("");
|
||||
|
||||
} else {
|
||||
$("#dName").prop("disabled", false).val(node.Name);
|
||||
|
@ -72,12 +81,9 @@
|
|||
$("#dInterfaces").append( $( "<option value='"+ this.Network +"'>" + this.IP + "[ " + intf.Name + " ]</option>" ) );
|
||||
});
|
||||
});
|
||||
/*
|
||||
skyapi().call("api/network","GetNeighbors", [ node.ID ], function(neighbors){
|
||||
$("#nodeTable").DataTable().clear().rows.add( neighbors ).draw();
|
||||
});
|
||||
*/
|
||||
|
||||
|
||||
$("#dDeviceType").prop("disabled",false).selectmenu().val(this.DeviceType);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -97,6 +103,7 @@
|
|||
{ title: "Letztes Update", data: "LastUpdate" },
|
||||
{ title: "Hersteller", data: "Vendor" },
|
||||
{ title: "Produkt", data: "Product" },
|
||||
{ title: "Gerätetyp", data: "DeviceType" },
|
||||
{ title: "Standort", data: "Location", render: function(d,t,r){ return d.Latitude + "/" + d.Longitude; } }
|
||||
],
|
||||
columnDefs: [
|
||||
|
|
|
@ -25,3 +25,28 @@
|
|||
</tr>
|
||||
</table>
|
||||
</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>
|
||||
<div>
|
||||
<a href="/static/crawlerhosts.html"><div>Hosts</div></a>
|
||||
<a href="/static/crawler/status.html"><div>Status</div></a>
|
||||
</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>
|
||||
|
|
Loading…
Reference in New Issue