UnboundLocalError (local variable 'dg_sizefactor' referenced before assignment)

CMK version: 2.0.0p25.cre
OS version: CentOS Linux release 7.9.2009 (Core)

Error message:
Exception: UnboundLocalError (local variable ‘dg_sizefactor’ referenced before assignment)

Traceback:

  File "/omd/sites/sgi/lib/python3/cmk/base/checking.py", line 564, in get_aggregated_result
    result = _aggregate_results(check_function(**kwargs))
  File "/omd/sites/sgi/lib/python3/cmk/base/checking.py", line 796, in _aggregate_results
    perfdata, results = _consume_and_dispatch_result_types(subresults)
  File "/omd/sites/sgi/lib/python3/cmk/base/checking.py", line 840, in _consume_and_dispatch_result_types
    for subr in subresults:
  File "/omd/sites/sgi/lib/python3/cmk/base/api/agent_based/register/check_plugins.py", line 89, in filtered_generator
    for element in generator(*args, **kwargs):
  File "/omd/sites/sgi/lib/python3/cmk/base/plugins/agent_based/oracle_asm_diskgroup.py", line 373, in check_oracle_asm_diskgroup
    total_mb = total_mb // dg_sizefactor

Output of “cmk --debug -vvn hostname”:

Checkmk version 2.0.0p25                                                                                                                                                      Try license usage history update.                                                                                                                                             Trying to acquire lock on /omd/sites/sgi/var/check_mk/license_usage/next_run                                                                                                  Got lock on /omd/sites/sgi/var/check_mk/license_usage/next_run                                                                                                                Trying to acquire lock on /omd/sites/sgi/var/check_mk/license_usage/history.json                                                                                              Got lock on /omd/sites/sgi/var/check_mk/license_usage/history.json                                                                                                            Next run time has not been reached yet. Abort.                                                                                                                                Releasing lock on /omd/sites/sgi/var/check_mk/license_usage/history.json                                                                                                      Released lock on /omd/sites/sgi/var/check_mk/license_usage/history.json                                                                                                       Releasing lock on /omd/sites/sgi/var/check_mk/license_usage/next_run                                                                                                          Released lock on /omd/sites/sgi/var/check_mk/license_usage/next_run                                                                                                           Loading autochecks from /omd/sites/sgi/var/check_mk/autochecks/sgi-dbprimario-ODA.mk                                                                                          Skipping service List_Backup_Nuvem_CDBGIRO: currently not in timeperiod check_interval_one_hour.                                                                              Skipping service ORA CDBGIRO.CDBROOT.TEMP Tablespace: currently not in timeperiod INTERVALO_2HORAS_TABLESPACE.                                                                Skipping service ORA CDBGIRO.CONTROLFILE RMAN Backup: currently not in timeperiod INTERVALO_4HORAS_RMAN.                                                                      Skipping service ORA CDBGIRO.DB_FULL RMAN Backup: currently not in timeperiod INTERVALO_4HORAS_RMAN.                                                                          Skipping service ORA CDBGIRO.SYSAUX Tablespace: currently not in timeperiod INTERVALO_2HORAS_TABLESPACE.                                                                      Skipping service ORA CDBGIRO.SYSTEM Tablespace: currently not in timeperiod INTERVALO_2HORAS_TABLESPACE.                                                                      Skipping service ORA CDBGIRO.UNDOTBS1 Tablespace: currently not in timeperiod INTERVALO_2HORAS_TABLESPACE.                                                                    Skipping service ORA CDBGIRO.USERS Tablespace: currently not in timeperiod INTERVALO_2HORAS_TABLESPACE.                                                                       Skipping service ORA CDBGIRO.WINT.STATSPACK_DATA Tablespace: currently not in timeperiod INTERVALO_2HORAS_TABLESPACE.                                                         Skipping service ORA CDBGIRO.WINT.SYSAUX Tablespace: currently not in timeperiod INTERVALO_2HORAS_TABLESPACE.                                                                 Skipping service ORA CDBGIRO.WINT.SYSTEM Tablespace: currently not in timeperiod INTERVALO_2HORAS_TABLESPACE.                                                                 Skipping service ORA CDBGIRO.WINT.TEMP Tablespace: currently not in timeperiod INTERVALO_2HORAS_TABLESPACE.                                                                   Skipping service ORA CDBGIRO.WINT.TS_DADOS Tablespace: currently not in timeperiod INTERVALO_2HORAS_TABLESPACE.                                                               Skipping service ORA CDBGIRO.WINT.TS_INDICE Tablespace: currently not in timeperiod INTERVALO_2HORAS_TABLESPACE.                                                              Skipping service ORA CDBGIRO.WINT.TS_MAXIMA Tablespace: currently not in timeperiod INTERVALO_2HORAS_TABLESPACE.                                                              Skipping service ORA CDBGIRO.WINT.UNDOTBS1 Tablespace: currently not in timeperiod INTERVALO_2HORAS_TABLESPACE.                                                               Skipping service ORA CDBGIRO.WINT.USERS Tablespace: currently not in timeperiod INTERVALO_2HORAS_TABLESPACE.
+ FETCHING DATA                                                                                                                                                      [43/2543]  Source: SourceType.HOST/FetcherType.TCP
[cpu_tracking] Start [7f221d2fcd00]
[TCPFetcher] Fetch with cache settings: DefaultAgentFileCache(base_path=PosixPath('/omd/sites/sgi/tmp/check_mk/cache/sgi-dbprimario-ODA'), max_age=MaxAge(checking=0, discovery=120, inventory=120), disabled=False, use_outdated=False, simulation=False)
Not using cache (Too old. Age is 3 sec, allowed is 0 sec)
[TCPFetcher] Execute data source
Connecting via TCP to 192.168.0.220:6556 (140.0s timeout)
Reading data from agent
Output is not encrypted
Write data to cache file /omd/sites/sgi/tmp/check_mk/cache/sgi-dbprimario-ODA
Trying to acquire lock on /omd/sites/sgi/tmp/check_mk/cache/sgi-dbprimario-ODA
Got lock on /omd/sites/sgi/tmp/check_mk/cache/sgi-dbprimario-ODA
Releasing lock on /omd/sites/sgi/tmp/check_mk/cache/sgi-dbprimario-ODA
Released lock on /omd/sites/sgi/tmp/check_mk/cache/sgi-dbprimario-ODA
Closing TCP connection to 192.168.0.220:6556
[cpu_tracking] Stop [7f221d2fcd00 - Snapshot(process=posix.times_result(user=0.0, system=0.0, children_user=0.0, children_system=0.0, elapsed=1.7999999998137355))]
  Source: SourceType.HOST/FetcherType.PIGGYBACK
[cpu_tracking] Start [7f221d2ec8e0]
[PiggybackFetcher] Fetch with cache settings: NoCache(base_path=PosixPath('/omd/sites/sgi/tmp/check_mk/data_source_cache/piggyback/sgi-dbprimario-ODA'), max_age=MaxAge(checking=0, discovery=120, inventory=120), disabled=False, use_outdated=False, simulation=False)
[PiggybackFetcher] Execute data source
No piggyback files for 'sgi-dbprimario-ODA'. Skip processing.
No piggyback files for '192.168.0.220'. Skip processing.
[cpu_tracking] Stop [7f221d2ec8e0 - Snapshot(process=posix.times_result(user=0.0, system=0.0, children_user=0.0, children_system=0.0, elapsed=0.0))]
[cpu_tracking] Start [7f221d2fcdc0]
+ PARSE FETCHER RESULTS
  Source: SourceType.HOST/FetcherType.TCP
Trying to acquire lock on /omd/sites/sgi/var/check_mk/persisted/sgi-dbprimario-ODA
Got lock on /omd/sites/sgi/var/check_mk/persisted/sgi-dbprimario-ODA
Releasing lock on /omd/sites/sgi/var/check_mk/persisted/sgi-dbprimario-ODA
Released lock on /omd/sites/sgi/var/check_mk/persisted/sgi-dbprimario-ODA
Stored persisted sections: lnx_packages, lnx_distro, lnx_cpuinfo, dmidecode, lnx_uname, lnx_video, lnx_ip_r
Using persisted section SectionName('lnx_packages')
Using persisted section SectionName('lnx_distro')
Using persisted section SectionName('lnx_cpuinfo')
Using persisted section SectionName('dmidecode')
Using persisted section SectionName('lnx_uname')
Using persisted section SectionName('lnx_video')
Using persisted section SectionName('lnx_ip_r')
  -> Add sections: ['check_mk', 'chrony', 'cifsmounts', 'cpu', 'df', 'diskstat', 'dmidecode', 'dmraid', 'ipmi', 'ipmi_discrete', 'kernel', 'lnx_bonding', 'lnx_cpuinfo', 'lnx_distro', 'lnx_if', 'lnx_ip_r', 'lnx_packages', 'lnx_uname', 'lnx_video', 'local', 'md', 'megaraid_bbu', 'megaraid_ldisks', 'megaraid_pdisks', 'mem', 'mounts', 'multipath', 'nfsmounts', 'oracle_asm_diskgroup', 'oracle_dataguard_stats', 'oracle_instance', 'oracle_iostats', 'oracle_jobs', 'oracle_locks', 'oracle_logswitches', 'oracle_longactivesessions', 'oracle_performance', 'oracle_processes', 'oracle_recovery_area', 'oracle_recovery_status', 'oracle_resumable', 'oracle_rman', 'oracle_sessions', 'oracle_systemparameter', 'oracle_tablespaces', 'oracle_undostat', 'postfix_mailq', 'postfix_mailq_status', 'ps_lnx', 'smart', 'systemd_units', 'tcp_conn_stats', 'uptime', 'vbox_guest']
  Source: SourceType.HOST/FetcherType.PIGGYBACK
No persisted sections loaded
  -> Add sections: []
Received no piggyback data
Loading item states
Trying to acquire lock on /omd/sites/sgi/tmp/check_mk/counters/sgi-dbprimario-ODA
Got lock on /omd/sites/sgi/tmp/check_mk/counters/sgi-dbprimario-ODA
Releasing lock on /omd/sites/sgi/tmp/check_mk/counters/sgi-dbprimario-ODA
Released lock on /omd/sites/sgi/tmp/check_mk/counters/sgi-dbprimario-ODA
[cpu_tracking] Stop [7f221d2fcdc0 - Snapshot(process=posix.times_result(user=0.10000000000000009, system=0.030000000000000027, children_user=0.0, children_system=0.0, elapsed=0.1299999998882413))]
Trying to acquire lock on /omd/sites/sgi/var/check_mk/crashes/base/119e8ec0-14f2-11ee-9a1f-000c291b9605/crash.info
Got lock on /omd/sites/sgi/var/check_mk/crashes/base/119e8ec0-14f2-11ee-9a1f-000c291b9605/crash.info
Releasing lock on /omd/sites/sgi/var/check_mk/crashes/base/119e8ec0-14f2-11ee-9a1f-000c291b9605/crash.info
Released lock on /omd/sites/sgi/var/check_mk/crashes/base/119e8ec0-14f2-11ee-9a1f-000c291b9605/crash.info
Traceback (most recent call last):
  File "/omd/sites/sgi/bin/cmk", line 98, in <module>
    exit_status = modes.call("--check", None, opts, args)
  File "/omd/sites/sgi/lib/python3/cmk/base/modes/__init__.py", line 69, in call
    return handler(*handler_args)
  File "/omd/sites/sgi/lib/python3/cmk/base/modes/check_mk.py", line 1643, in mode_check
    return checking.do_check(
  File "/omd/sites/sgi/lib/python3/cmk/base/decorator.py", line 37, in wrapped_check_func
    status, infotexts, long_infotexts, perfdata = check_func(hostname, *args, **kwargs)
  File "/omd/sites/sgi/lib/python3/cmk/base/checking.py", line 212, in do_check
    num_success, plugins_missing_data = _do_all_checks_on_host(
  File "/omd/sites/sgi/lib/python3/cmk/base/checking.py", line 343, in _do_all_checks_on_host
    success = execute_check(
  File "/omd/sites/sgi/lib/python3/cmk/base/checking.py", line 486, in execute_check
    submit, data_received, result = get_aggregated_result(
  File "/omd/sites/sgi/lib/python3/cmk/base/checking.py", line 564, in get_aggregated_result
    result = _aggregate_results(check_function(**kwargs))
  File "/omd/sites/sgi/lib/python3/cmk/base/checking.py", line 796, in _aggregate_results
    perfdata, results = _consume_and_dispatch_result_types(subresults)
  File "/omd/sites/sgi/lib/python3/cmk/base/checking.py", line 840, in _consume_and_dispatch_result_types
    for subr in subresults:
  File "/omd/sites/sgi/lib/python3/cmk/base/api/agent_based/register/check_plugins.py", line 89, in filtered_generator
    for element in generator(*args, **kwargs):
  File "/omd/sites/sgi/lib/python3/cmk/base/plugins/agent_based/oracle_asm_diskgroup.py", line 373, in check_oracle_asm_diskgroup
    total_mb = total_mb // dg_sizefactor
UnboundLocalError: local variable 'dg_sizefactor' referenced before assignment

Agent Section Output:

<<<oracle_asm_diskgroup:sep(124)>>>
MOUNTED|FLEX|DATA|4096|4194304|0|4883968|3442088|NVD_S00_PHLN052101RLP1|Y|REGULAR|0|8640000|1
MOUNTED|FLEX|DATA|4096|4194304|0|4883968|3442088|NVD_S04_PHLN0135001CP1|Y|REGULAR|0|8640000|1
MOUNTED|FLEX|DATA|4096|4194304|0|1024|980|SSD_QRMDSK_P1|Y|QUORUM|0|8640000|1
MOUNTED|FLEX|RECO|4096|4194304|0|1220608|146048|NVD_S00_PHLN052101RLP2|N|REGULAR|0|8640000|1
MOUNTED|FLEX|RECO|4096|4194304|0|1220608|146048|NVD_S04_PHLN0135001CP2|N|REGULAR|0|8640000|1
MOUNTED|FLEX|RECO|4096|4194304|0|1024|1012|SSD_QRMDSK_P2|N|QUORUM|0|8640000|1

I don’t get any errors running the agent directly or mk_oracle (Even using -l or -t).

Hi @francisco.fernandes and welcome to the checkmk forum. :v:

I’m pretty sure you can fix your issue by updating your checkmk server to a supported and newer version. The version you are using is quite old and not supported anymore.
In the meantime a lot of changes have been made to the mk_oracle check plugin as you can see in the werks.

Please update your site according to the official documentation from 2.0.0 to 2.1.0 and then 2.2.0.

Hope this helps. :slight_smile:

Regards
Norm

In addition to @Norm i can say that this error was fixed with 2.0.0p29
Problem was the “FLEX” type.

I got it! Thanks for the answers. A hug from Brazil.

2 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.