Projet

Général

Profil

Révision 827c75fb

ID827c75fb47ab8100a205977e5f7ccd791a11ecf3
Parent ca01c6e3
Enfant 183b2330

Ajouté par K.Shimadera il y a presque 9 ans

Fix for pull request https://github.com/munin-monitoring/contrib/pull/786

Voir les différences:

plugins/oracle/oracle_sysstat_
411 411
key=cachehit
412 412
# buf_hitratio = 1 - physical_reads / ( db_block_gets + consistent_gets )
413 413
# lib_hitratio = 1 - reloads / pins
414
# dic_hitratio = ( gets - misses ) / gets
414
# dict_hitratio = ( gets - misses ) / gets
415
field_info=$( for field in buf_physical buf_logical lib_pins lib_reloads dict_gets dict_getmisses
416
   do
417
       echo "${field}.graph no"
418
       echo "${field}.type DERIVE"
419
       echo "${field}.min 0"
420
       echo "${field}.label ${field}"
421
   done
422
)
415 423
global_attrs[$key]="
416 424
    graph_title Oracle Cache Hit Ratio
417 425
    graph_category db
......
420 428
    graph_info Oracle Cache Hit Ratio - The graph shows cache hit ratio between munin-update intervals (5 minutes in most cases).
421 429
    graph_scale no
422 430

  
423
    $( for field in buf_physical buf_logical lib_pins lib_reloads dic_gets dic_getmisses
424
       do
425
           echo "${field}.graph no"
426
           echo "${field}.type DERIVE"
427
           echo "${field}.min 0"
428
           echo "${field}.label ${field}"
429
       done
430
    )
431

  
431
    ${field_info}
432 432
    buf_hitratio.cdef 100,1,buf_physical,buf_logical,/,-,*,FLOOR
433 433
    lib_hitratio.cdef 100,1,lib_reloads,lib_pins,/,-,*,FLOOR
434
    dic_hitratio.cdef 100,dic_gets,dic_getmisses,-,dic_gets,/,*,FLOOR
434
    dict_hitratio.cdef 100,dict_gets,dict_getmisses,-,dict_gets,/,*,FLOOR
435 435
"
436 436
data_attrs[$key]="
437 437
    buf_hitratio GAUGE LINE Buffer Cache Hit Ratio
438 438
    lib_hitratio GAUGE LINE Library Cache Hit Ratio
439
    dic_hitratio GAUGE LINE Dictionary Cache Hit Ratio
439
    dict_hitratio GAUGE LINE Dictionary Cache Hit Ratio
440 440
"
441 441
getvalue_func[$key]=getvalue_cachehit
442 442

  
......
470 470
    graph_category db
471 471
    graph_args --base 1000 --lower-limit 0 --rigid
472 472
    graph_vlabel microseconds
473
    graph_info Oracle Wait Events - It may looks wierd that Y-axis indicates 'microseconds per second'. Although number of times of wait event looks easier to understand, in many cases the number of events does not matter, but wait time become more important to analyze bottle necks.
473
    graph_info Oracle Wait Events - It may look wierd that Y-axis indicates 'microseconds per second'. Although number of times of wait event looks easier to understand, in many cases the number of events does not matter, but wait time become more important to analyze bottle necks.
474 474
"
475 475
data_attrs[$key]=""
476 476
getfield_func[$key]=getfield_eventwait
......
638 638
    # print data source attributes
639 639
    # split line into field,type,draw,label 
640 640
    local fields field type draw label
641
    fields=
641 642
    while read -r field type draw label
642 643
    do
643
        [ -z "${field:-}" ] && continue
644
        fields="${fields:-} ${field}"
644
        [ -z "$field" ] && continue
645
        fields="${fields} ${field}"
645 646

  
646 647
        echo "${field}.type ${type}"
647 648
        echo "${field}.draw ${draw}"
......
678 679
    do
679 680
        [ -z "$field" ] && continue
680 681

  
681
        cat <<EOF
682
${sqlplus_variables}
683
VAR vf VARCHAR2(64)
684
VAR vl VARCHAR2(64)
685
EXEC :vf := '${field}' 
686
EXEC :vl := '${label}' 
687
SELECT
688
  :vf || '.value ' || value
689
FROM
690
  v\$sysstat
691
WHERE
692
  name = :vl;
693
EOF
682
        echo "${sqlplus_variables}
683
          VAR vf VARCHAR2(64)
684
          VAR vl VARCHAR2(64)
685
          EXEC :vf := '${field}' 
686
          EXEC :vl := '${label}' 
687
          SELECT
688
            :vf || '.value ' || value
689
          FROM
690
            v\$sysstat
691
          WHERE
692
            name = :vl;
693
        "
694 694
    done <<< "${data_attrs[$module]}" | ${sqlplus} "${oracle_auth}"
695 695
}
696 696

  
......
700 700
    do
701 701
        [ -z "$field" ] && continue
702 702

  
703
        cat <<EOF
704
${sqlplus_variables}
705
VAR vf VARCHAR2(64)
706
VAR vl VARCHAR2(64)
707
EXEC :vf := '${field}' 
708
EXEC :vl := '${label}' 
709
SELECT
710
  :vf || '.value ' || bytes
711
FROM
712
  v\$sgainfo
713
WHERE
714
  name = :vl;
715
EOF
703
        echo "${sqlplus_variables}
704
          VAR vf VARCHAR2(64)
705
          VAR vl VARCHAR2(64)
706
          EXEC :vf := '${field}' 
707
          EXEC :vl := '${label}' 
708
          SELECT
709
            :vf || '.value ' || bytes
710
          FROM
711
            v\$sgainfo
712
          WHERE
713
            name = :vl;
714
        "
716 715
    done <<< "${data_attrs[$module]}" | ${sqlplus} "${oracle_auth}"
717 716
}
718 717

  
......
722 721
    do
723 722
        [ -z "$field" ] && continue
724 723

  
725
        cat <<EOF
726
${sqlplus_variables}
727
VAR vf VARCHAR2(64)
728
VAR vl VARCHAR2(64)
729
EXEC :vf := '${field}' 
730
EXEC :vl := '${label}' 
731
SELECT
732
  :vf || '.value ' || value
733
FROM
734
  v\$pgastat
735
WHERE
736
  name = :vl;
737
EOF
724
        echo "${sqlplus_variables}
725
          VAR vf VARCHAR2(64)
726
          VAR vl VARCHAR2(64)
727
          EXEC :vf := '${field}' 
728
          EXEC :vl := '${label}' 
729
          SELECT
730
            :vf || '.value ' || value
731
          FROM
732
            v\$pgastat
733
          WHERE
734
            name = :vl;
735
        "
738 736
    done <<< "${data_attrs[$module]}" | ${sqlplus} "${oracle_auth}"
739 737
}
740 738

  
......
744 742
    do
745 743
        [ -z "$field" ] && continue
746 744

  
747
        cat <<EOF
748
${sqlplus_variables}
749
VAR vf VARCHAR2(64)
750
VAR vl VARCHAR2(64)
751
EXEC :vf := '${field}' 
752
EXEC :vl := '${label}' 
753
SELECT
754
  :vf || '.value ' || ROUND( value / 1000000 )
755
FROM
756
  v\$sys_time_model
757
WHERE
758
  stat_name = :vl;
759
EOF
745
        echo "${sqlplus_variables}
746
          VAR vf VARCHAR2(64)
747
          VAR vl VARCHAR2(64)
748
          EXEC :vf := '${field}' 
749
          EXEC :vl := '${label}' 
750
          SELECT
751
            :vf || '.value ' || ROUND( value / 1000000 )
752
          FROM
753
            v\$sys_time_model
754
          WHERE
755
            stat_name = :vl;
756
        "
760 757
    done <<< "${data_attrs[$module]}" | ${sqlplus} "${oracle_auth}"
761 758
}
762 759

  
......
779 776
;
780 777
SELECT 'lib_pins.value '    || SUM(pins)    FROM v\$librarycache;
781 778
SELECT 'lib_reloads.value ' || SUM(reloads) FROM v\$librarycache;
782
SELECT 'dic_gets.value '      || SUM(gets)      FROM v\$rowcache;
783
SELECT 'dic_getmisses.value ' || SUM(getmisses) FROM v\$rowcache;
779
SELECT 'dict_gets.value '      || SUM(gets)      FROM v\$rowcache;
780
SELECT 'dict_getmisses.value ' || SUM(getmisses) FROM v\$rowcache;
784 781
EOF
785 782
}
786 783

  

Formats disponibles : Unified diff