Manage Multiple Devices with 1 Plugin

Answered

Comments

13 comments

  • Avatar
    Andrey Terentyev

    Hello James,

    Please, let me ask several precising questions.

    I want to display and set threshold information for iDRAC servers like memory, temperature, and CPU usage and generate an event based on user defined thresholds.

    Where do you want this information to be displayed?

    The customer would like to target 1 or more iDRAC servers to manage.

    What does "to manage" mean in this context? It is about doing what specifically?

    JIRA-VMS-22575

    JIRA-VMS-23073

    0
    Comment actions Permalink
  • Avatar
    James Christofis

    Where do you want this information to be displayed?

    What is the ideal location to display that kind of information?  Ideally it would be live data being read at intervals from the server.  I'm not sure if the best place would be on a "tile" that is typically used for cameras or some other place.  Maybe a separate plugin

    What does "to manage" mean in this context? It is about doing what specifically?

    This would be at what temperature to send an event, memory use or CPU load percents.  For example, if a server gets above a certain temperature create an event to let the user know it's too hot.  This would also be for memory and CPU load.  If either gets above a user defined percent, send an event.

    0
    Comment actions Permalink
  • Avatar
    Andrey Terentyev

    James,

    What are you writing sounds like you need a Network Monitoring System like Zabbix, NetXMS etc.
    I can't still get what could be the relation to Nx Witness Video Management System.

    As major function Nx Witness pulls video streams from the cameras and gives the possibility to somehow treat these streams (save video streams, detect motions in them, make bookmarks etc).  In particular, it allows creating plugins of three types to extend functionality: video stream analytics plugin, video source plugin (aka camera driver), storage plugin (aka storage driver).

    Here you can find detailed description https://support.networkoptix.com/hc/en-us/articles/360042852893-Nx-Meta-Architecture-Overview

    Analytics plugin might be used to process video stream, detect objects in it and send some metadata to back to the Server. The Server displays this metadata in the live video stream in the Nx Desktop as well as saves the metadata along the video stream to the video archive.

    I want to display and set threshold information for iDRAC servers like memory, temperature, and CPU usage and generate an event based on user defined thresholds.

    In this picture, in what video stream do you want thus information to be displayed?

    0
    Comment actions Permalink
  • Avatar
    James Christofis

    The goal is more diagnostic and quality oriented.  For instance if the system is running too hot or using too much memory video quality deteriorates.  It's meant to offer the user an overview of how the server is performing.

    That aside, is there a way to dynamically add plugins or items in a plugin?  My current project aside it would be helpful to have some dynamic functionality in whatever plugin I need to write.

    0
    Comment actions Permalink
  • Avatar
    Evgeny Balashov

    Hi James! 

    Have you checked out our build-in system health information feature? https://support.networkoptix.com/hc/en-us/articles/360051456834-Nx-Witness-Health-Monitoring I understand, that it doesn't meet your current requirements (namely, it doesn't generate events and doesn't report), but it might be useful in general.

     

    Regarding your initial request, as Andrey mentioned, today we have metadata SDK, but it is more tailored to video streams.

    Still, you can use it to resolve your issue in hacky way:

    • plugins can report configuration capabilities, so you can let users to configure thresholds  
    • plugins can generate analytics events or plugin diagnostic events
    • plugins can send information into the system in form of metadata

    The main 'hack' is that metadata today has to be attached to the camera, so the user needs to enable your plugin on some random camera. 

     

    In future, we wanted to make scenarios like yours easier to implement, but we don't know yet when will we be able to release it.

    0
    Comment actions Permalink
  • Avatar
    James Christofis

    Maybe my example isn't quite what I'm trying to accomplish.  More specifically, is there a way to add or remove fields dynamically from a plugin?  Is there a way to reuse the same administration portion of a plugin across multiple devices when the device list isn't static?

    0
    Comment actions Permalink
  • Avatar
    Andrey Terentyev

    James,

    Could you please give us a visual example?
    Just take a screenshot of the Nx Desktop and put some drawings there, showing the fields to be dynamically removed, places where threshold information is supposed to be displayed any other things you have on your mind in this regard.

    0
    Comment actions Permalink
  • Avatar
    James Christofis

    Option 1

    A long list of information in the right panel each corresponding to 1 server.  To add a new server select "Add Server."

    Option 2

    Click "Add Server" and create a new instance of the plugin in the left tree pane

    Again, this is only my current project.  I'm not so concerned with what information I capture.  I'm more interested in how to make either the plugin main pane dynamic or how I can create or remove a new instance of the plugin.

    It would be nice if both options could remove a server as well.

    0
    Comment actions Permalink
  • Avatar
    Andrey Terentyev

    Thanks, I got your idea.

    Let me think a while on a possible implementation.
    I'll update later on.

    0
    Comment actions Permalink
  • Avatar
    Andrey Terentyev

    James,

    In the stub_analytics_plugin of the Metadata SDK we have an example of dynamically updating settings model of the plugin in the "Camera settings" window depending on the "Setting model" value.
    Have a look how it works.

    DeviceAgent setting model has nested sections. The model is declared in the Engine class manifest and is overridden by the DeviceAgent the DeviceAgent::settingsReceived() method.

    Here is the code

    Result<const ISettingsResponse*> DeviceAgent::settingsReceived()
    {
    const auto settingsResponse = new sdk::SettingsResponse();

    const std::string settingsModel = settingValue(kSettingsModelSettings);

    if (ini().sendSettingsModelWithValues)
    {
    if (settingsModel == kAlternativeSettingsModelOption)
    {
    settingsResponse->setModel(kAlternativeSettingsModel);
    }
    else if (settingsModel == kRegularSettingsModelOption)
    {
    const std::string languagePart = (settingValue(kCitySelector) == kGermanOption) ? kGermanCitiesPart : kEnglishCitiesPart;

    settingsResponse->setModel(kRegularSettingsModelPart1
    + languagePart
    + kRegularSettingsModelPart2);
    }
    }

    parseSettings();
    updateObjectGenerationParameters();
    updateEventGenerationParameters();
    updateManifest();

    return settingsResponse;
    }

    This code sets a predefined model stored in the kAlternativeSettingsModel variable.

    settingsResponse->setModel(kAlternativeSettingsModel);

    This is called in order to update online the view in the Nx Desktop.

    updateManifest();
    void DeviceAgent::updateManifest()
    {
    pushManifest(manifestString());
    }

    Here is how this approach can be applied in your scenario.

    The settings displayed in the "System administration" -> "Plugins" tab are declared in the Plugin class manifest as the "engineSettingsModel" and can be overridden in the Engine::settingsReceived() method.

    In what way the "engineSettingsModel" should be overridden? What exactly has to be changed to make as you write "the plugin main pane dynamic"?

    You can dynamically generate a settings model with additional "items" (iDRAC servers) and set this new model by the settingsResponse->setModel() method in the Engine::settingsReceived() 

    At the moment, it's not possible to display dynamically created nested sections in the Engine manifest what would be the best solution for your task.

     

    0
    Comment actions Permalink
  • Avatar
    James Christofis

    Sorry it took so long for me to respond.  I had to shuffle my priorities for a bit but I'm back.

    I mirrored i_engine.h and engine.h to mimic what's implemented in i_device_agent.h, i_consuming_device_agent.h and consuming_device_agent.h in the stub solution.  It builds and produces the dll.  When I go to install the plugin, the server service constantly starts, stops, and starts again.  I'm not actually calling settingsReceived in code yet. I implemented pushManifest and all the dependent classes.  When I modified it for just device_agent, it installed and ran without issue.  I'm wondering if changing the handler in i_engine.h is causing the problem.  Or should pushManifest exist in that context like it does in i_device_agent?  Further I noticed a specific difference between deviceAgentSettingsModel and engineSettingsModel.

    I haven't been able to create sections in engineSettingsModel like I do in deviceAgentSettingsModel. My code is the Visual C++ solution from the sdk zip slightly modified for proof of concept.  Up until now I hadn't touched anything in analytics or analytics/helpers.

    Do you have an example of pushManifest working for engineSettingsModel?  I could follow it to recreate what I'm trying accomplish.  If at all possible, would I be able to setup a remote support session?  Something where you could look at what I have and tell me if I'm doing something wrong?

    0
    Comment actions Permalink
  • Avatar
    Andrey Terentyev

    Hello James,

    Do you have an example of pushManifest working for engineSettingsModel? I could follow it to recreate what I'm trying accomplish. If at all possible, would I be able to setup a remote support session? Something where you could look at what I have and tell me if I'm doing something wrong?

    the pushManifest is not implemented for the Engine helper class neither in the SDK nor on the Server side. So, at the moment it is not possible to dynamically update engineSettingsModel is the manner similar to what is possible for deviceAgentSettingsModel.

    I created a task for this feature. Hopefully, it will be implemented in future version but no terms so far.

    0
    Comment actions Permalink
  • Avatar
    Andrey Terentyev

    Hello James,

    The issue has been fixed in the recently published 5.0 beta version.

    https://nxvms.com/downloads/5.0.0.34342

    Though the Engine manifest in to yet dynamically updatable.

    0
    Comment actions Permalink

Please sign in to leave a comment.