Hello
We are a little bit confuse with you description because the Process surveyor monitor processes and not services.
Its goal is to generate event when a process is missing (windows) our reach a specific state (Linuw x/unix)
If you copy the plugin in an active view you get the status of the plugin and not the status of the process that you monitor.
To get the status of the process in the active view you should monitor the counter of the event that are generated when the process state change.
You can read the following documentation example made with a trap but it is roughly the same principle.
The object in the active should read the event counter and on the retrun value you can change the color of the icon.
Another solution is to use the LUA scripting if you use an Extended Edition.
In that case you don’t need the Process surveyor plugin because you directly monitor the process from The active view object.
Read the following documentation to know how to launch a script from an active view object
http://www.luteus.biz/Download/LoriotPro_Doc/V4_Extended_Edition/LoriotPro-V4-LUA_scripting_documentation/Scheduling_scripts_EN.htmThe full scripting documentation
http://www.luteus.biz/Download/LoriotPro_Doc/V4_Extended_Edition/LoriotPro-V4-LUA_scripting_documentation/LoriotPro_LUA_scripting_documentation.htmHere is an example of script that monitor process. It can be necessary to adapt it to your exact requirement.
--------------------------------------------------------------------
-- Loriotpro V4
-- To run correctly this file is located to bin/config/script
-- Input values
-- lp_index index for this script ".1"
-- lp_oid SNMP OID for this script "ifnumber"
-- lp_host default ip address for this script "127.0.0.1"
-- Output Values
lp_value = 0;
lp_buffer ="error";
-- dofile(lp.GetPath().."/config/script/loriotinit.lua");
ProcessList = {};
ProcessStatus = {}
ProcessList[1] = "snmp.exe"; ProcessStatus[1] = "stopped";
ProcessList[1] = "notepad.exe"; ProcessStatus[1] = "stopped";
--MibFileExist = lp.IsLoadedMIBRef("HOST-RESOURCE-MIB");
if MibFileExist ~= nil then
lp.Trace("Host Resource MIB File not compiled\n");
end
lp_value = lp.GetRows(lp_host,"hrswrunname.0,hrswrunstatus","myArray");
if lp_value ~= nil then
lp.Trace(("return "..lp_value.." lines\n"));
for i=0 , (lp_value-1) do
lp.Trace("line "..i.." with index "..myArray["I-"..i].."-");
lp.Trace(myArray["hrswrunname-"..i].."/"..myArray["hrswrunstatus-"..i].."\n");
--lp.Trace(myArray["hrswrunname-"..i].."\n");
--lp.Trace(myArray["hrswrunstatus-"..i].."\n");
if (myArray["hrswrunname-"..i] == ProcessList[1]) then
if(myArray["hrswrunstatus-"..i] ~= "running") then
ProcessStatus[1] = "stopped";
else
ProcessStatus[1] = "running";
end
end
end
--ENvoie une alarme si un process de la list est manquant et not running
tblsize = table.getn(ProcessStatus);
for i=1 , tblsize do
if ProcessStatus
== "stopped" then
alarm=string.format("WARNING Host : "..lp_host.." - Process : ".. ProcessList.." not running");
lp.Print(alarm);
evntnumber = 92000 + i;
lp.SendEvent( evntnumber,2,lp_host,"255.255.255.255",alarm);
end
end
lp_buffer="ok";
else
lp_buffer="error";
end
----------------------------------------------------------------------------------------
In the active view rule you can check the return value and change the color according to it.