Compare Current metric custom with the previous value

Hello

It's simple, no doubt, but I can't find the answer anywhere.  First of all, a bit of background.

A customer asked us if Foglight can monitor a particular file.  If it has not been updated in 30 minutes, something is wrong therefore to trigger an alarm.

Foglight can do out of the box, but I wrote a script and used the Script Agent Builder (thanks to http://en.community.dell.com/techcenter/performance-monitoring/foglight-administrators/w/admins-wiki/6155.custom-script-agent-1-leverage-an-existing-monitoring-script-to-push-data-into-foglight for the modification of the file time.  This script:

off @echo

(for %%d to do (C:\Scripts\useful.txt) (for /f "tokens = 1-2" %% in (' echo % ~ your ') do (set _modified = % H)))

@rem generate the results in the form of script agent

echo FILE_LAST_MODIFIED of TABLE

echo START_SAMPLE_PERIOD

echo message. StringObservation.obs=%_modified%

echo END_SAMPLE_PERIOD

echo END_TABLE

.. can every 30 minutes via the agent and the product of output such as:

Note that this test file is, in general, static; I would update manually to test as I did above to display the time of 15:03 updated change.

However, I can't work on how to program the alarm status.  I know what I want to do:

If #message.current # == {#message.previous #}

Returns true;

}

else {}

Returns false;

}

.. .but simply does not how to get previous value.

Can someone help me please?

Thank you

Brian

I went in the way of thinking, that it was a metric based on your initial code, but take a look at the screenshot, it appears to be a string. If delta will not work.

I * think * work delta on datetime data type, so if you can make to your script at the beginning, it would simplify.

Tags: Dell Tech

Similar Questions

  • Compare the value of the column with the previous column and Populate values

    Hi all


    Please help me to get the required sql

    I have a table T1 as example below

    Id1 Id2 Column1 Column2
    1 1 name1 null
    1 2 name2 XYZ
    1 3 name3 null
    1 4 name4 abc
    1 5 name5 null



    If the value is null, ishould then fill with the previous value. until he finds a following value.
    The result should be as below

    Id1 Id2 Column1 Column2
    1 1 name1 null
    1 2 name2 XYZ
    1 3 name3 XYZ
    1 4 name4 abc
    1 5 abc name5

    Please help me to get the required sql

    Thanks in advance

    Hello

    Here's one way:

    SELECT    id1
    ,       id2
    ,       column1
    ,       LAST_VALUE (column2  IGNORE NULLS)
                     OVER ( PARTITION BY  id1          -- if needed
                                ORDER BY         id2
                       )        AS column2
    FROM      t1
    ORDER BY  id1, id2                         -- if needed
    ;
    

    I'm guessing only a few things, as what makes a line 'previous' or 'next '.

    I hope that answers your question.
    If not, post a small example of data (CREATE TABLE and only relevant columns, INSERT statements) for all tables and also post the results desired from these data.
    Explain, using specific examples, how you get these results from these data.
    Always tell what version of Oracle you are using. «LAST_VALUE...» IGNORE NULLS"requires that Oracle 10.1 or higher.

  • How to compare the new values with the old values in triggers.

    Dear all,

    Please tell me how to compare the new values with the old values in triggers.

    Hi, the employee example is in the document. You'd better read yourself.

    CREATE OR REPLACE TRIGGER Print_salary_changes
      BEFORE DELETE OR INSERT OR UPDATE ON Emp_tab
      FOR EACH ROW
    WHEN (new.Empno > 0)
    DECLARE
        sal_diff number;
    BEGIN
        sal_diff  := :new.sal  - :old.sal;
        dbms_output.put('Old salary: ' || :old.sal);
        dbms_output.put('  New salary: ' || :new.sal);
        dbms_output.put_line('  Difference ' || sal_diff);
    END;
    /
    
  • When I delete the "screensaverissecure" with the registry value, it reappears again in the registry after I stop and start the system the next day. Help, please

    When I delete the "screensaverissecure" with the registry value, it reappears again in the registry after I stop and start the system the next day. Help, please
    use widows xp

    Hello

     
    1. Have you tried to Hibernate for ever in the power settings option?
     
    To resolve this problem, you can follow the steps below.
     
    (a) click and start
    (b) type power Option in the start search bar.
    (c) now select click Change plan for the current plan of the selected power.
    (d) now click on advanced power settings.
    (e) scroll down and click on the sign more next to sleep.
    (f) now click on allow the eve hybrid and turn it off.
    (g) click on the option put into hibernation after and set it to never.
     
  • update to column values (false) in a copy of the same table with the correct values

    Database is 10gr 2 - had a situation last night where someone changed inadvertently values of column on a couple of hundred thousand records with an incorrect value first thing in the morning and never let me know later in the day. My undo retention was not large enough to create a copy of the table as it was 7 hours comes back with a "insert in table_2 select * from table_1 to timestamp...» "query, so I restored the backup previous nights to another machine and it picked up at 07:00 (just before the hour, he made the change), created a dblink since the production database and created a copy of the table of the restored database.

    My first thought was to simply update the table of production with the correct values of the correct copy, using something like this:


    Update mnt.workorders
    Set approvalstat = (select b.approvalstat
    mnt.workorders a, mnt.workorders_copy b
    where a.workordersoi = b.workordersoi)
    where exists (select *)
    mnt.workorders a, mnt.workorders_copy b
    where a.workordersoi = b.workordersoi)

    It wasn't the exact syntax, but you get the idea, I wanted to put the incorrect values in x columns in the tables of production with the correct values of the copy of the table of the restored backup. Anyway, it was (or seem to) works, but I look at the process through OEM it was estimated 100 + hours with full table scans, so I killed him. I found myself just inserting (copy) the lines added to the production since the table copy by doing a select statement of the production table where < col_with_datestamp > is > = 07:00, truncate the table of production, then re insert the rows from now to correct the copy.

    Do a post-mortem today, I replay the scenario on the copy that I restored, trying to figure out a cleaner, a quicker way to do it, if the need arise again. I went and randomly changed some values in a column number (called "comappstat") in a copy of the table of production, and then thought that I would try the following resets the values of the correct table:

    Update (select a.comappstat, b.comappstat
    mnt.workorders a, mnt.workorders_copy b
    where a.workordersoi = b.workordersoi - this is a PK column
    and a.comappstat! = b.comappstat)
    Set b.comappstat = a.comappstat

    Although I thought that the syntax is correct, I get an "ORA-00904: 'A'. '. ' COMAPPSTAT': invalid identifier ' to run this, I was trying to guess where the syntax was wrong here, then thought that perhaps having the subquery returns a single line would be cleaner and faster anyway, so I gave up on that and instead tried this:

    Update mnt.workorders_copy
    Set comappstat = (select distinct)
    a.comappstat
    mnt.workorders a, mnt.workorders_copy b
    where a.workordersoi = b.workordersoi
    and a.comappstat! = b.comappstat)
    where a.comappstat! = b.comappstat
    and a.workordersoi = b.workordersoi

    The subquery executed on its own returns a single value 9, which is the correct value of the column in the table of the prod, and I want to replace the incorrect a '12' (I've updated the copy to change the value of the column comappstat to 12 everywhere where it was 9) However when I run the query again I get this error :

    ERROR on line 8:
    ORA-00904: "B". "" WORKORDERSOI ": invalid identifier

    First of all, I don't see why the update statement does not work (it's probably obvious, but I'm not)

    Secondly, it is the best approach for updating a column (or columns) that are incorrect, with the columns in the same table which are correct, or is there a better way?

    I would sooner update the table rather than delete or truncate then re insert, as it was a trigger for insert/update I had to disable it on the notice re and truncate the table unusable a demand so I was re insert.

    Thank you

    Hello

    First of all, after post 79, you need to know how to format your code.

    Your last request reads as follows:

    UPDATE
      mnt.workorders_copy
    SET
      comappstat =
      (
        SELECT DISTINCT
          a.comappstat
        FROM
          mnt.workorders a
        , mnt.workorders_copy b
        WHERE
          a.workordersoi    = b.workordersoi
          AND a.comappstat != b.comappstat
      )
    WHERE
      a.comappstat      != b.comappstat
      AND a.workordersoi = b.workordersoi
    

    This will not work for several reasons:
    The sub query allows you to define a and b and outside the breakets you can't refer to a or b.
    There is no link between the mnt.workorders_copy and the the update and the request of void.

    If you do this you should have something like this:

    UPDATE
      mnt.workorders     A      -- THIS IS THE TABLE YOU WANT TO UPDATE
    SET
      A.comappstat =
      (
        SELECT
          B.comappstat
        FROM
          mnt.workorders_copy B   -- THIS IS THE TABLE WITH THE CORRECT (OLD) VALUES
        WHERE
          a.workordersoi    = b.workordersoi      -- THIS MUST BE THE KEY
          AND a.comappstat != b.comappstat
      )
    WHERE
      EXISTS
      (
        SELECT
          B.comappstat
        FROM
          mnt.workorders_copy B
        WHERE
          a.workordersoi    = b.workordersoi      -- THIS MUST BE THE KEY
          AND a.comappstat != b.comappstat
      )
    

    Speed is not so good that you run the query to sub for each row in mnt.workorders
    Note it is condition in where. You need other wise, you will update the unchanged to null values.

    I wouold do it like this:

    UPDATE
      (
        SELECT
          A.workordersoi
          ,A.comappstat
          ,B.comappstat           comappstat_OLD
    
        FROM
          mnt.workorders        A      -- THIS IS THE TABLE YOU WANT TO UPDATE
          ,mnt.workorders_copy  B      -- THIS IS THE TABLE WITH THE CORRECT (OLD) VALUES
    
        WHERE
          a.workordersoi    = b.workordersoi      -- THIS MUST BE THE KEY
          AND a.comappstat != b.comappstat
      ) C
    
    SET
      C.comappstat = comappstat_OLD
    ;
    

    This way you can test the subquery first and know exectly what will be updated.
    This was not a sub query that is executed for each line preformance should be better.

    Kind regards

    Peter

  • How to check the previous value of the element in a multi-record block

    Oracle Version: 10 g
    Forms Version: 10 g

    Hi all
    Hello everyone, I have a multi-dossier block in a form where one of the values of elements is of LOV.user can select the value of LOV.

    If once the user selects the value of LOV and moves to the next of the multi-file record, and selects the value of LOV again, I shouldn't allow users to select the previous value of the user in order to avoid duplication of records.

    and important remark is that I should get there before you save it in the database because once registered in the database I can compare the values and hide the previous value.


    Any help will be appreciated.


    Thanks and greetings

    This is a question frequently asked in the forum! There are several different solutions. Take a look at the following articles. Both will perform the necessary verification of duplicates.
    Forms - registration of treatment group (value in double check...
    or
    Avoid records duplicated in a block

    If none of these solutions don't work for you, search the forum for other options.

    Hope this helps,
    Craig B-)

    If someone useful or appropriate, please mark accordingly.

  • An update on an index column with the same value generates an index to the top

    An update on an index column with the same value generates an update of the index?


    Thank you

    In addition to my previous answer, see also

    http://orainternals.WordPress.com/2010/11/04/does-an-update-statement-modify-the-row-if-the-update-modifies-the-column-to-same-value/

    Riyaj Shamsudeen has this to say:
    "+ We have an index on this column v1 and we update this column indexed too." Oracle was updating the indexed column? N ° if the values match the level of the indexed column, then the code of RDBMS isn't up-to-date index, a feature for optimization again. Only the row of table is updated, and the index is not updated. + "

    Hemant K Collette

  • I just got a new modem (Arris SB6190) and now my Airport Extreme does not connect.  It worked fine with the previous modem (a rented one TWC).  Help!

    I just got a new modem (Arris SB6190) and now my Airport Extreme does not connect.  It worked fine with the previous modem (a rented one TWC).  Help!

    Always recommended to reset the airport back to settings by default and then set up again whenever you have a new modem or change your Internet Service provider.

    Turn off the new modem for at least 30 minutes. More is better.

    Perform a hard reset on the AirPort Extreme, then it turned off.

    Make sure that the Ethernet cable connects the modem to the "O" on the AirPort Extreme WAN port

    After the power of the modem 30 minutes down, turn on the modem and let it run for at least 5 minutes by itself.

    Then, turn on the airport and let it run a few minutes

    Set up AirPort Extreme again

    Important note... There are many reports of problems with the modem Arris SB and airports. Both are great products, but they do seem to work perfectly together for some users.

  • I have a column with two values, separated by a space, in each line. How to create 2 new columns with the first value in a column, and the second value in another column?

    I have a column with two values, separated by a space, in each line. How do I create 2 new columns with the first value in one column and the second value in another column?

    Add two new columns after than the original with space separated values column.

    Select cell B1 and type (or copy and paste it here) the formula:

    = IF (Len (a1) > 0, LEFT (A1, FIND ("", A1) −1), ' ')

    shortcut for this is:

    B1 = if (Len (a1) > 0, LEFT (A1, FIND ("", A1) −1), ' ')

    C1 = if (Len (a1) > 0, Member SUBSTITUTE (A1, B1 & "", ""), "")

    or

    the formula of the C1 could also be:

    = IF (Len (a1) > 0, RIGHT (A1, LEN (A1) −FIND ("", A1)), "")

    Select cells B1 and C1, copy

    Select cells B1 at the end of the C column, paste

  • Why is my computer now slower, with Firefox 4, then it was with the previous version? He stops and crashes constantly. How can I go back to the previous version?

    When I'm on Facebook or a game, it freezes and I have to hit Ctrl alt del, for a response. Within a few seconds more, the same problem occurs. I did not have this problem with the previous version.

    Well, if you want to back up and try to fix it.

    Firefox 3.6.16 is at http://www.mozilla.com/en-US/firefox/all-older.html

    www.mozilla.com -> all systems and languages-> Firefox 3.6.16

  • I have a problem with the previous results of LEDs and indicators of compensation

    I'm working on a proper VI for my building project, but there is a problem... The project here is to define the occurrence of the error and the error type to decide what actions are required to protect the circuit. This isn't a problem here...

    The problem is when I run the VI for the first time... Everything is good and I got what I need... But when I run it after that... The new results to come out with the results of the first round... So my problem is with the previous results of LEDs and indicators of compensation

    Hope my question is clear and not confusing

    Well, show us a code instead. How do you call the VI?

    Have you tried the option: "properties of the VI... run... clear the flags when called?

  • I installed Windows Developer Preview and I need to double to boot my system with the previous version of Windows 7 that is already installed on my computer.

    How Dual boot my windows 8

    Hello
    I have recently installed windows 8 developer preview and I need to dual boot my system with the previous version of windows 7, which is already installed on my computer.please me how to Dual boot my system with windows7.i need both versions on my computer suggest.
    Please suggest me a way to dual boot

    Ask in the forum Windows Developer Preview:
    http://social.msdn.Microsoft.com/forums/en-us/windowsdeveloperpreviewgeneral

  • Updated with the hash values column

    Hi all

    I have a requirement to add a column to a table and fill it with the hash values. The table contains an xml column and hash value of this column need to be filled to newly added column. I think that the ora_hash function will not support the xml type column. Just tested with the following script and it works.

    update TBL_COMPONENT_XSL set hash_val = ora_hash((SELECT TCX.COMPONENT_XSL.getStringVal() FROM TBL_COMPONENT_XSL TCX where rownum =1));
    

    can you please suggest me how to fill the column with the hash values.

    SQL> desc TBL_COMPONENT_XSL
     Name                                      Null?    Type
     ----------------------------------------- -------- ----------------------------
     COMPONENT_XSL_ID                          NOT NULL NUMBER(18)
     LINE_OF_BUSINESS                          NOT NULL VARCHAR2(30)
     ORDER_SOURCE                              NOT NULL VARCHAR2(10)
     COMPONENT_NAME                            NOT NULL VARCHAR2(30)
     COMPONENT_SCHEMA_VERSION                  NOT NULL NUMBER(9)
     ACCESS_LEVEL                              NOT NULL VARCHAR2(30)
     COMPONENT_XSL                             NOT NULL SYS.XMLTYPE STORAGE BINARY
     DESCRIPTION                               NOT NULL VARCHAR2(200)
     HASH_VAL                                           NUMBER
    
    

    HASH_VAL is the newly added column.

    Thank you

    Mani

    What happens if you try with:

    update of TCX TBL_COMPONENT_XSL set hash_val = ora_hash (TCX.COMPONENT_XSL.getStringVal ());

    update of TCX TBL_COMPONENT_XSL set hash_val = ora_hash (TCX.COMPONENT_XSL.getClobVal ());

    Index: http://www.orafaq.com/forum/t/70829/

    Concerning

    Girish Sharma

  • Since I load Acrobat Reader DC, when I try to save the document, word to PDF, the pdf file pages are cut on the width. I use Microsoft Office Word 2007 and I have no problem with the previous version of Adobe Reader. Should what settings I adjust?

    Since I load Acrobat Reader DC, when I try to save the document, word to PDF, the pdf file pages are cut on the width. I use Microsoft Office Word 2007 and I have no problem with the previous version of Adobe Reader. Should what settings I adjust?

    Hi judithl34724699,

    If you want to convert Word files to PDF with the Adobe Reader application then it is possible with the service Pack of PDF. Try to use the service on the web: https://cloud.acrobat.com/convertpdf

    Also try to use a different file type.

    Thank you

    Abhishek

  • I have recently installed Windows 10 free update.  Now I am unable to delete .pdf files and get the invalid error message "Function MS-DOS."  It has never been a problem with the previous Windows 8.1.  I contacted Microsoft technical support and I was tol

    I have recently installed Windows 10 free update.  Now I am unable to delete .pdf files and get the invalid error message "Function MS-DOS."  It has never been a problem with the previous Windows 8.1.  I contacted Microsoft technical support and they told me there is a problem with the .pdf application and I need to contact Adobe Acrobat. This can be corrected?

    uninstall any version of acrobat is installed.

    clean by Download Adobe Reader and Acrobat tool - Adobe Labs

    Restart your computer.

    delete all to delete pdf files.

    If this fails, it is a problem of ms.  If this attempt is successful, then reinstall your acrobat.

Maybe you are looking for

  • Redirect German Site (various)

    I have a brand new computer win 10 Desktop. My old computer has Firefox, I signed in and ran a synchronization. Now on the new computer I connect and it synchronizes and transfers all the stuff on. However! a lot of sites I navigate will German, .of

  • Running Java?

    On the news today, they say I should stop using Java and uninstall it. How will this affect my XP Home Edition?

  • Intel ITU H.264 (H264) codec

    I deleted by mistake the codec Intel ITU H.264 (H264) and then emptied my trash. Now I can't watch DVD or videos from my cam corder. What should I do now to restore it. I'm not very good on a computer so please do as simple answers that you can. Than

  • Worldwide blackBerry Smartphone app problems

    I updated on my 9810 with apps, however, there is a red star on my app icon and it does not download new applications. It is said "to continue using BlackBerry App World, you need to upgrade your current version. "For more information, please visit

  • "BOLD" BB blackBerry smartphones

    Just the current "BOLD". updated from the curve. Can I add other icons on the homepage as the six that are standard?