• 16.04.2024, 14:01
  • Registrieren
  • Anmelden
  • Sie sind nicht angemeldet.

 

Lieber Besucher, herzlich willkommen bei: Aqua Computer Forum. Falls dies Ihr erster Besuch auf dieser Seite ist, lesen Sie sich bitte die Hilfe durch. Dort wird Ihnen die Bedienung dieser Seite näher erläutert. Darüber hinaus sollten Sie sich registrieren, um alle Funktionen dieser Seite nutzen zu können. Benutzen Sie das Registrierungsformular, um sich zu registrieren oder informieren Sie sich ausführlich über den Registrierungsvorgang. Falls Sie sich bereits zu einem früheren Zeitpunkt registriert haben, können Sie sich hier anmelden.

AquaSuite Sensor API

Donnerstag, 18. Mai 2017, 11:57

Is there an API available to provide sensor data to the AquaSuite application? I'd like to be able to monitor the temperature sensors on my RAID card (Areca 1883ix-24). Unfortunately this data is only available to me via SNMP so I would like to write a plugin to add support for this.

Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von »burnettm« (18. Mai 2017, 12:03)

Sonntag, 4. Juni 2017, 05:58

yes, you can do this by using aquasuite plugin sdk provided by aquacomputer.

https://github.com/aquacomputer/plugin_sdk


for details:
first, you need to decode your temperature data from source, then write into a text file( To keep providing latest information, you must to updating those numbers continuity).
download plugin_sdk from github and unzip, you can see a demo named PluginImportDemo, open it using visual studio.
in visual studio, you need to modify several places to make the program can read temperature from the text file as mentioned above, in c# language.
after program compiled, a dll file will be generated, put that dll file into \aquasuite\Plugins folder, restart your aquasutie service and software, finally you can see the number shown in the data quick view tab.

code modification like this:

DummyData.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Management;
using AquaComputer.Plugin;
using System.IO;

namespace AquaComputer.Plugin.Demo
{
public class DummyData
{
private string source = string.Empty;
Random rnd_number;

public DummyData(string plugin_id)
{
source = plugin_id;
rnd_number = new Random((int)DateTime.Now.TimeOfDay.TotalMilliseconds);
}

public SensorGroup read_sensors()
{

// read from host
// or you can read temperture data directly from snmp, In that way, you dont need a intermediate text file anymore.
StreamReader sr = new StreamReader(@"\\vmware-host\Shared Folders\Host Documents\hwinfo", Encoding.Default);

String line;
float temperture = 50.0f;


if ((line = sr.ReadLine()) != null)
{
string[] info = line.Split(',');
temperture = float.Parse(info[3]);
}

SensorGroup main_group = new SensorGroup();
main_group.source_id = source;
main_group.name = source;

SensorNode node;

// show data in Data quick view
node = new SensorNode();
node.source_id = source;
node.idx = 0;
node.identifier = "GPU_0";
node.is_sensor = true;
node.name = "GPU 0 Temperture";
node.unit = (int)SensorNodeBase.UnitType.Temperature;
node.range = (int)SensorNodeBase.Range.None;
node.time_scale = (int)SensorNodeBase.TimeScale.None;
// node.sensor_value = rnd_number.Next(2000, 10000) / 100.0;
node.sensor_value = temperture;
main_group.children.Add(node);

node = new SensorNode();
node.source_id = source;
node.idx = 0;
node.identifier = "loz9324zld";
node.is_sensor = true;
node.name = "Dummy Sensor 2";
node.unit = (int)SensorNodeBase.UnitType.Temperature;
node.range = (int)SensorNodeBase.Range.None;
node.time_scale = (int)SensorNodeBase.TimeScale.None;
node.sensor_value = rnd_number.Next(5000, 7000) / 100.0;
main_group.children.Add(node);

return main_group;
}

}
}

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »ryukinkou« (4. Juni 2017, 10:18)