Config - Plugin

Object type: plugin

Request URL: /rest/config/plugin

Methods:

Parameters:

Example GET /rest/config/plugin Copied

{
   "list" : [
      {
         "envvars" : "",
         "name" : "check_nrpe",
         "servicechecks" : [
            {
               "name" : "/",
               "ref" : "/rest/config/servicecheck/47"
            },
            ....
            {
               "name" : "Z Drive",
               "ref" : "/rest/config/servicecheck/71"
            }
         ]
      },
      {
         "envvars" : "",
         "name" : "check_tcp",
         "servicechecks" : [
            {
               "name" : "AFS",
               "ref" : "/rest/config/servicecheck/1"
            },
            ....
            {
               "name" : "X.400",
               "ref" : "/rest/config/servicecheck/32"
            }
         ]
      },
      {
         "envvars" : "",
         "name" : "check_snmp_linkstatus",
         "servicechecks" : [
            {
               "name" : "Discards",
               "ref" : "/rest/config/servicecheck/101"
            },
            {
               "name" : "Errors",
               "ref" : "/rest/config/servicecheck/100"
            },
            {
               "name" : "Interface",
               "ref" : "/rest/config/servicecheck/95"
            }
         ]
      }
   ],
   "summary" : {
      "allrows" : "125",
      "page" : "1",
      "rows" : "3",
      "totalpages" : "42",
      "totalrows" : "125"
   }
}

URL: /rest/config/plugin/PLUGINNAME

Methods:

Note

If you have the plugin on a remote collector, this will not be removed.

Plugin - Upload Copied

Warning

Only upload plugins from trusted sources. Uploading untrusted and unverified scripts could compromise your system’s integrity.

URL: /rest/config/plugin/upload

Method:

When uploading:

Parameters:

Returns for a failure:

{
 success: false,                 // or true
 error: "Plugin already exists", // If success is false, will return an internationalised string for display
 detail: "File not found",       // May exist if success is false. Will have further information about failure
}

Returns for a success:

{
 return_code: 0,                                          // Return code of script
 stdout: 'text from plugin running -h\nwith extra lines', // Output from plugin
 stderr: '',                                              // Stderr from plugin
 exists: true,                                            // Returns true if a plugin of the same name is already live
 valid_plugin: true,                                      // This is a valid plugin based on heuristics. Could return false
}

Plugin - Import Copied

Warning

Only import plugins from trusted sources. Importing untrusted and unverified scripts could compromise your system’s integrity.

URL: /rest/config/plugin/import

Method:

When importing, check for config {“Controller::Settings”}->{allow_plugin_upload} and fail if not true

Parameters:

Returns:

{ success: true }
["Opsview"] ["API", "Technical Reference"]

Was this topic helpful?