New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

200.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free PRTG
Download >>

 

What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

 

Top Tags


View all Tags


Monitoring linux update

Votes:

0

Your Vote:

Up

Down

Hello.

I would like to know how i can see if a linux server need to be update.

I've install and test prtg mini-probe. And it's working on the probe.

The mini-probe can monitoring other linux server or i have to install the mini-probe on each linux server ?

We have more than hundred linux server so i need to find a solution.

linux linux-os mini-probe ssh update

Created on Jul 18, 2017 12:02:43 PM by  psmulski (0) 1



9 Replies

Votes:

0

Your Vote:

Up

Down

Hi there,

I don't have an out of the box solution for this. With the Windows Update Powershell sensor what we do is performing a query that returns details about missing updates. I am not aware if such a query can be performed in Linux, maybe someone else can chip in on this.

Kind regards,

Erhard

Created on Jul 19, 2017 1:47:57 PM by  Erhard Mikulik [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Is there any solution to this? We use the windows update sensor and it works great. We have a large number of linux boxes in our enterprise, and it would be nice to monitor when they have outstanding security updates. Please advise.

Created on Dec 13, 2017 3:21:53 PM by  andrewleeds30 (0) 1



Votes:

0

Your Vote:

Up

Down

Hello Andrew,

Not really. In Windows there are certain Powershell commands available that are being used in the sensor to retrieve those details. With Linux, not so much, basically all you find around that topic leads to apt-get update and apt-get upgrade, but nothing that just performs the query and presents it in some sort of overview of missing/required updates and if so the output is quite hard to parse in order to represent the data like in a sensor for example.

Kind regards,

Erhard

Created on Dec 15, 2017 7:28:21 AM by  Erhard Mikulik [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Hello Linux lovers,

Both yum and dnf for RedHat 7/8 (and CentOS 7/8) can take the argument "check-update" which returns the exit code of 100 if there are available updates, 0 for no available updates and 1 if an error occurs. Wrapping this in a small shellscript and use the SSH Script Advanced probe can let you monitor this with PRTG. Adding a small script (excuse my bad BASH skills) as proof of concept.

Be aware that the scanning interval of course have to be changed since it is quiet a heavy probe, and that the timeout have to be much higher, maybe several minutes depending on your install base and external connectivity.

Also, this gobbles up probes, one per server to check.

#!/bin/bash

dnf -q check-update > /dev/null

RET=$?

echo "<prtg>
   <result>
       <channel>Updates available</channel>"

if [ $RET -eq 0 ]; then
echo "       <value>0</value>"
fi

if [ $RET -eq 100 ]; then
echo "       <value>1</value>"
echo "       <warning>1</warning>"
fi

echo "   </result>"

echo "</prtg>"

Created on Feb 26, 2020 4:52:12 PM by  magnusahl (19) 1

Last change on Jun 19, 2020 9:42:16 AM by  Felix Wiesneth [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Hello,

we have implemented a solution like from the prtg script world https://www.paessler.com/script-world/all/all/all?stats=all&fulltext=yum&newOnly=false&scroll=0&key=1582742563531

So our PRTG instance is connection via SSH to the box and checks via "yum check-update | wc -l" to count the number of updates

after that we use the threshold of 200 packages to set to warn (new release available) it is also possible via "rpm -someOption" to get the date of the last installed /updated package. And if the date is to far just alarm via threshold :) you could also combine this with the ssh advance sensor.

(Does only need to rune every day one time or even in a week so no real performance issues for PRTG or the system you monitor)

regards Michele

(always available for interesting Monitoring tasks :) )

Created on Feb 26, 2020 6:46:30 PM by  Michele Jetz (102) 1



Votes:

0

Your Vote:

Up

Down

Hi,

this is rather an easy job, but i´m lost at last, PRTG does not understand me, maybe anyone can help? I´m new to PRTG, coming from the Nagios-Corner, lots of common, lots of differences... So, on my monitored Linux machines, there is already the package "monitoring-plugins-basic" installed, so why don´t use that? check_apt does the job fine, as we can see

/usr/lib/nagios/plugins/check_apt

APT OK: 0 packages available for upgrade (0 critical updates). |available_upgrades=0;;;0 critical_updates=0;;;0

Fine...

Now using ssh-script sensor on that, and prtg throws an error, what was expected...

Antwort nicht wohlgeformt: "APT OK: 0 packages available for upgrade (0 critical updates). |available_upgrades=0;;;0 critical_updates=0;;;0 "

PRTG awaits a number, not a text. So, trying to be clever and formatting the output a bit...

/usr/lib/nagios/plugins/check_apt |cut -d ' ' -f 3

0

Thats what we want!

But on the ssh-script sensor, the result is

Antwort nicht wohlgeformt: "0 " (Code: PE132)

And that where I am lost...what am I doing wrong?

Regards

Created on Jun 19, 2020 5:11:36 AM by  malo (0)

Last change on Jun 19, 2020 9:43:34 AM by  Felix Wiesneth [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Hi there,

Please note that PRTG's return cannot be read because it is not in the correct format. PRTG does not know if "0 " is the value or the message. Therefore a specific format must be used which is described in the web interface under Setup > PRTG API > Custom Sensors. The script should look like this:

returncode:value:message

Following returncodes are possible:

0	OK
1	WARNING
2	System Error (e.g. a network/socket error)
3	Protocol Error (e.g. web server returns a 404)
4	Content Error (e.g. a web page does not contain a required word)

Kind regards

Felix Wiesneth - Team Tech Support

Created on Jun 19, 2020 9:41:25 AM by  Felix Wiesneth [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Hi Felix,

thanks for your fast reply and the hint. I got this running now :)

Prerequisites: monitoring-plugins-basic installed on target system, your script executable in /var/prtg/scripts (mine is called updates.sh)

#!/bin/sh

#returncode:value:message
#0      OK
#1      WARNING
#2      System Error (e.g. a network/socket error)
#3      Protocol Error (e.g. web server returns a 404)
#4      Content Error (e.g. a web page does not contain a required word)

UPDATES=`/usr/lib/nagios/plugins/check_apt |cut -d ' ' -f 3`
echo "0:$UPDATES:Update(s) verfügbar"

Works fine on Debian and Ubuntu. Feel free to use and improve

Regards

Created on Jun 22, 2020 10:27:10 AM by  malo (0)

Last change on Jun 22, 2020 10:55:58 AM by  Felix Wiesneth [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Hi there,

I'm happy to hear that it is now working. Thank you for sharing.


Kind regards

Felix Wiesneth - Team Tech Support

Created on Jun 22, 2020 10:57:26 AM by  Felix Wiesneth [Paessler Support]



Please log in or register to enter your reply.


Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.