LoriotPro Forum
18 July 2012 à 04:42:34 *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Test de newsletter
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Active view and processsuveyor  (Read 1733 times)
GOK
Néophyte
*
Posts: 6


View Profile
« on: 29 April 2009 à 23:55:54 »

I have made an active view of a host that has 3 services running, and they are monitored with processsurveyor ( service changes to running = 2, service changes to not running = 4 ) I inserted them into the active view map with the Insert Child objects option.

Dynamic polling interval is 15 seconds, when I stop the services they go red for 15 sec then they go back to green even though the services has not been restarted.

What do i need to change so they stay red while the service is stopped?
Logged
Luteus Support
Modérateur Global
Néophyte
*****
Posts: 10


View Profile WWW
« Reply #1 on: 30 April 2009 à 09:43:17 »

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.htm

The full scripting documentation

http://www.luteus.biz/Download/LoriotPro_Doc/V4_Extended_Edition/LoriotPro-V4-LUA_scripting_documentation/LoriotPro_LUA_scripting_documentation.htm


Here 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.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!