No graph found for temperature senzor

(DD98) #1

Hi.

I can’t figure it out, why Graphite isn’t showing Graph (only) for my new service ( Service: Actual Cold Aisle Temperature)? The problem is only the graph, service for it self is working -SNMP OK…it shows the temperature.

For all other services (CPU, load,Memory) it shows Graphs but not for this new Temperature service it doesn’t.

What am I missing? Any help most appreciated.

Here is my config:
template Host “clima” {
check_command = “hostalive”
vars.agent_type = “snmp”
vars.snmp_community = “community_pass”
}

object Host “Clima A” {
import “clima”
address = “IP_ADDRESS”
check_command = “hostalive”
vars.os = “other”
}

apply Service “Actual Cold Aisle Temperature” {
import “generic-service”
check_command = “snmp”
vars.snmp_oid = “1.3.6.1.4.1.476.1.42.3.9.20.1.20.1.2.1.6086”
vars.snmp_warning = “28.0”
vars.snmp_critical = “30.0”
//vars.snmp_miblist = “DISMAN-EVENT-MIB”

assign where host.vars.agent_type == “snmp” && host.vars.snmp_community != “”
}

(Aflatto) #2

Does the output of the check execution has any perfdata ?
Can you paste the actual output of the command execution ?

(DD98) #3

Hi, sorry for the late replay. I was abroad for 14 days. Now I’m back into this issue, and I realized, that Graph need a new template, so I created one new template (temp.ini) under /usr/share/icingaweb2/modules/graphite/templates/temp.ini. Sadly the graph is not showing in IcingaWeb.

Here is my file temp.ini:
[KlimaTemp.graph]
check_command = “temperature”

[KlimaTemp.metrics_filters]
value = “$service_name_template$.perfdata.memory.value”
max = “$service_name_template$.perfdata.memory.max”

[KlimaTemp.urlparams]
areaAlpha = “0.5”
areaMode = “all”
lineWidth = “2”
min = “0”
yUnitSystem = “binary”

[KlimaTemp.functions]
value = “alias(color($metric$, ‘#1a7dd7’), ‘Used (bytes)’)”
max = “alias(color($metric$, ‘#cfd7e6’), ‘Size (bytes)’)”

File services.conf:
apply Service “KlimaTemp” {
import “generic-service”
check_command = “temperature”
assign where host.vars.temp == “ok”
}

File host.conf:
object Host “Klima B” {
import “klima”
address = “IP ADDRESS”
check_command = “hostalive”
vars.os = “other”

    vars.notification["mail"] = {
    groups = [ "icingaadmins" ]
    }
    vars.temp = "ok"

}

Under my graphite web page, I don’t see this new service:
image

I did a debug (&graph_debug=1) and here is the output:

Graphs assembling process record

  • Icinga check command: ‘temperature’
  • Obscured check command: NULL
  • Applying templates for check command ‘temperature’
    ++ Applying template ‘KlimaTemp’
    +++ Fetched 0 metric(s) from ‘http://IP_ADDRESS/metrics/expand?query=icinga2.Klima_B.services.KlimaTemp.temperature.output.temperature.value’
    +++ Fetched 0 metric(s) from ‘http://IP_ADDRESS/metrics/expand?query=icinga2.Klima_B.services.KlimaTemp.temperature.perfdata.temp.max’
    +++ Excluded 0 metric(s)
    +++ Combined 0 metric(s) to 0 chart(s)
  • Applying default templates, excluding previously used metrics
    ++ Not applying template ‘default-host’
    ++ Applying template ‘default-service’
    +++ Fetched 0 metric(s) from ‘http://IP_ADDRESS/metrics/expand?query=icinga2.Klima_B.services.KlimaTemp.temperature.perfdata.%2A.value’
    +++ Excluded 0 metric(s)
    +++ Combined 0 metric(s) to 0 chart(s)
    ++ Not applying template ‘multi2-host’
    ++ Applying template ‘multi2-service’
    +++ Fetched 0 metric(s) from ‘http://IP_ADDRESS/metrics/expand?query=icinga2.Klima_B.services.KlimaTemp.temperature.perfdata.%2A.%2A.value’
    +++ Excluded 0 metric(s)
    +++ Combined 0 metric(s) to 0 chart(s)
    ++ Not applying template ‘multi3-host’
    ++ Applying template ‘multi3-service’
    +++ Fetched 0 metric(s) from ‘http://IP_ADDRESS/metrics/expand?query=icinga2.Klima_B.services.KlimaTemp.temperature.perfdata.%2A.%2A.%2A.value’
    +++ Excluded 0 metric(s)
    +++ Combined 0 metric(s) to 0 chart(s)

Fetched metric is 0.

Any ideas?

BR

(DD98) #4

image

For KlimaB.

#5

Please show the output of an snmpget for the OID used to retrieve the metric.

(DD98) #6

Here you go:

[root@xxxx conf.d]# snmpget -v 2c -c string IP_ADDRESS 1.3.6.1.4.1.476.1.42.3.9.20.1.20.1.2.1.6086
SNMPv2-SMI::enterprises.476.1.42.3.9.20.1.20.1.2.1.6086 = STRING: “23.1”

#7

SNMP requests returning values of type STRING don’t produce performance data. Two options:

  • you can search for another OID containing numeric data
  • you can pipe the output and add valid performance data yourself, something like

Temperature 23.1 | temp=23.1

Information on valid performance data can be found here.

(DD98) #8

Hi. Tnx for the tip. Ass you said, perfdata wasn’t producing any data, so I add pipe, and now the grap is working.

What I did in the plugin:

if ($status == $OK)
{
$returnstring = “- No problems.”;
print "OK : Temperatura $temp | ‘Temperatura’=$temp";
}
elsif ($status == $WARNING)
{
print " WARNING : Temperatura $temp | ‘Temperatura’=$temp";
}
elsif ($status == $CRITICAL)
{
print "CRITICAL : Temperatura $temp | ‘Temperatura’=$temp";
}

Thanks so much for the help. I really appreciate it.

BR