Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
min_warning not working?
#1
I have a temperature check for my Raspberry Pi. This is an example data. It has data 69, min_warning 65, but in the console, it is still shown as status "normal", not "warning".

What did I do wrong?

Also,
- instead of "CPU Temperature is 69.698 °C", the console shows "CPU Temperature is 69.698 °C.". Should I use ° instead?
- can I use decimals as data? Like 69.698?

Thanks!

Code:
<module>
        <name><![CDATA[CPU Temp]]></name>
        <type><![CDATA[generic_data]]></type>
        <data><![CDATA[69]]></data>
        <description><![CDATA[CPU Temperature is 69.698 °C.]]></description>
        <min_warning><![CDATA[65]]></min_warning>
        <min_critical><![CDATA[70]]></min_critical>
        <module_group><![CDATA[System]]></module_group>
</module>
 Reply
#2
(09-07-2018, 03:17 PM)annomatik Wrote: I have a temperature check for my Raspberry Pi. This is an example data. It has data 69, min_warning 65, but in the console, it is still shown as status "normal", not "warning".

What did I do wrong?

Also,
- instead of "CPU Temperature is 69.698 °C", the console shows "CPU Temperature is 69.698 °C.". Should I use &deg; instead?
- can I use decimals as data? Like 69.698?

Thanks!

Code:
<module>
        <name><![CDATA[CPU Temp]]></name>
        <type><![CDATA[generic_data]]></type>
        <data><![CDATA[69]]></data>
        <description><![CDATA[CPU Temperature is 69.698 °C.]]></description>
        <min_warning><![CDATA[65]]></min_warning>
        <min_critical><![CDATA[70]]></min_critical>
        <module_group><![CDATA[System]]></module_group>
</module>

Good morning annomatik,

It seems to have all write, but its a bug that doesn't show you the warning state. Can you please show me the module conf to see why could it fail.

The problem of the show of description is a entity problem that nowadays is showed.

The decimal you can go to Setup -> Visual Styles -> Data precision to configure the decimals you want to be shown.

Alberto
 Reply
#3
Hi, thanks. I have written my own module. In the agent overview, one agent, which has a temperature of almost 90° C (!) is still shown as normal, in the db, it does not go to warn / critical either.

Here are the interesting parts:

in pandora_agent.conf, I call it like this:

Code:
# system info

module_plugin cpu-info

and cpu-info does this (currently only works for Raspberry Pi, not sure how to do that for Windows and other Unix machines):

Code:
function print_kv_limits {

       # $1 = key
       # $2 = type (e.g. generic_proc)
       # $3 = value
       # $4 = description
       # $5 = module_group (e.g. Application)
       # $6 = min-warn limit
       # $7 = min-critical limit

       echo "<module>"
       echo -e "\t<name><![CDATA[$1]]></name>"
       echo -e "\t<type><![CDATA[$2]]></type>"
       echo -e "\t<data><![CDATA[$3]]></data>"
       echo -e "\t<description><![CDATA[$4]]></description>"
       echo -e "\t<min_warning><![CDATA[$6]]></min_warning>"
       echo -e "\t<min_critical><![CDATA[$7]]></min_critical>"
       echo -e "\t<module_group><![CDATA[$5]]></module_group>"
       echo "</module>"

       return


}


# -------------------
# CPU Temperature
#

if [[ "$platform_family" == "RPi" ]]; then

       cpuTemp0=$(cat /sys/class/thermal/thermal_zone0/temp)
       cpuTemp1=$(($cpuTemp0/1000))
       cpuTemp2=$(($cpuTemp0/100))
       cpuTempM=$(($cpuTemp2 % $cpuTemp1))

       temp="${cpuTemp1}.${cpuTemp2}"

       print_kv_limits "CPU Temp" "generic_data" "$cpuTemp1" "CPU Temperature is $temp °C." "System" 65 70

else

       print_kv "CPU Temp" "generic_data" "-1" "CPU Temperature unknown." "System"

fi
 Reply
#4
(09-10-2018, 11:22 AM)annomatik Wrote: Hi, thanks. I have written my own module. In the agent overview, one agent, which has a temperature of almost 90° C (!) is still shown as normal, in the db, it does not go to warn / critical either.

Here are the interesting parts:

in pandora_agent.conf, I call it like this:

Code:
# system info

module_plugin cpu-info

and cpu-info does this (currently only works for Raspberry Pi, not sure how to do that for Windows and other Unix machines):

Code:
function print_kv_limits {

       # $1 = key
       # $2 = type (e.g. generic_proc)
       # $3 = value
       # $4 = description
       # $5 = module_group (e.g. Application)
       # $6 = min-warn limit
       # $7 = min-critical limit

       echo "<module>"
       echo -e "\t<name><![CDATA[$1]]></name>"
       echo -e "\t<type><![CDATA[$2]]></type>"
       echo -e "\t<data><![CDATA[$3]]></data>"
       echo -e "\t<description><![CDATA[$4]]></description>"
       echo -e "\t<min_warning><![CDATA[$6]]></min_warning>"
       echo -e "\t<min_critical><![CDATA[$7]]></min_critical>"
       echo -e "\t<module_group><![CDATA[$5]]></module_group>"
       echo "</module>"

       return


}


# -------------------
# CPU Temperature
#

if [[ "$platform_family" == "RPi" ]]; then

       cpuTemp0=$(cat /sys/class/thermal/thermal_zone0/temp)
       cpuTemp1=$(($cpuTemp0/1000))
       cpuTemp2=$(($cpuTemp0/100))
       cpuTempM=$(($cpuTemp2 % $cpuTemp1))

       temp="${cpuTemp1}.${cpuTemp2}"

       print_kv_limits "CPU Temp" "generic_data" "$cpuTemp1" "CPU Temperature is $temp °C." "System" 65 70

else

       print_kv "CPU Temp" "generic_data" "-1" "CPU Temperature unknown." "System"

fi

Good morning annomatik,

But in the create module when you use the plugin for the first time, can you see if the parameters of warning and critical are correctly considered?

Alberto
 Reply
#5
Good question. Where can I find that? I only send the XML, I didn't do anything in the console.
 Reply
#6
(09-11-2018, 09:14 AM)annomatik Wrote: Good question. Where can I find that? I only send the XML, I didn't do anything in the console.

Hi annomatik,

Try to go to the agent that is using the plugin, and it should have created a new module with the information you are trying to get out with the plugin. Go to that module and see if the warning and critical information is ok. It should be called as the plugin I think.

Alberto
 Reply
#7
I have in the meantime put the corresponding Raspberry Pi into a case with a fan and added heatsinks, it's now a lot cooler.

I have enabled debug mode, here's the corresponding (current) XML for the CPU Temperature:

Code:
<module>
       <name><![CDATA[CPU Temp]]></name>
       <type><![CDATA[generic_data]]></type>
       <data><![CDATA[48.488]]></data>
       <description><![CDATA[CPU Temperature is 48.488 °C.]]></description>
       <min_warning><![CDATA[65]]></min_warning>
       <min_critical><![CDATA[70]]></min_critical>
       <module_group><![CDATA[System]]></module_group>
</module>
 Reply
#8
(09-15-2018, 04:41 PM)annomatik Wrote: I have in the meantime put the corresponding Raspberry Pi into a case with a fan and added heatsinks, it's now a lot cooler.

I have enabled debug mode, here's the corresponding (current) XML for the CPU Temperature:

Code:
<module>
       <name><![CDATA[CPU Temp]]></name>
       <type><![CDATA[generic_data]]></type>
       <data><![CDATA[48.488]]></data>
       <description><![CDATA[CPU Temperature is 48.488 °C.]]></description>
       <min_warning><![CDATA[65]]></min_warning>
       <min_critical><![CDATA[70]]></min_critical>
       <module_group><![CDATA[System]]></module_group>
</module>

Good morning annomatik,

But the problems persists? Have you seen if the plugin creates you a new module?

Alberto
 Reply
#9
Hi! yes, the problem persists. The plugin always sends the fresh data, so the modules are created new every 5 minutes.

Could this be related to the "°" character? It gets messed up in the Pandora console, even though with the ![CDATA it shouldn't mess with it (I think).
 Reply
#10
(09-17-2018, 11:15 AM)annomatik Wrote: Hi! yes, the problem persists. The plugin always sends the fresh data, so the modules are created new every 5 minutes.

Could this be related to the "°" character? It gets messed up in the Pandora console, even though with the ![CDATA it shouldn't mess with it (I think).

Good morning annomatik,

But it creates you a new module each time? It does not just change the data from the module created the first time? It could be caused by that character, we will investigate it and try to get a solution.

Alberto
 Reply


Users browsing this thread: 1 Guest(s)


(c) 2006-2018 Artica Soluciones Tecnológicas. Contents of this wiki are under Create Common Attribution v3 licence. | pandorafms.com | pandorafms.org

Theme © MyBB Themes