File tree Expand file tree Collapse file tree 1 file changed +25
-3
lines changed
Expand file tree Collapse file tree 1 file changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -332,7 +332,7 @@ public function monitorIspcVer() {
332332
333333 /* the ISPC-Version has no state. It is, what it is */
334334 $ state = 'no_state ' ;
335-
335+
336336 /*
337337 * Return the Result
338338 */
@@ -446,7 +446,7 @@ public function monitorMemUsage() {
446446 * maybe someone knows better...???...
447447 */
448448 $ state = 'no_state ' ;
449-
449+
450450 /*
451451 * Return the Result
452452 */
@@ -607,7 +607,7 @@ public function monitorServices() {
607607 $ state = 'error ' ; // because service is down
608608 }
609609 }
610-
610+
611611 /*
612612 * Return the Result
613613 */
@@ -791,6 +791,28 @@ public function monitorSystemUpdate() {
791791 $ state = 'info ' ;
792792 $ data ['output ' ] = shell_exec ('glsa-check -pv --nocolor affected 2>/dev/null ' );
793793 }
794+ } elseif (file_exists ('/etc/SuSE-release ' )) {
795+
796+ /*
797+ * update and find the upgrade.
798+ * if there is any output, then there is a needed update
799+ */
800+ $ aptData = shell_exec ('zypper -q lu ' );
801+ if ($ aptData == '' ) {
802+ /* There is nothing to update! */
803+ $ state = 'ok ' ;
804+ } else {
805+ /*
806+ * There is something to update! this is in most cases not critical, so we can
807+ * do a system-update once a month or so...
808+ */
809+ $ state = 'info ' ;
810+ }
811+
812+ /*
813+ * Fetch the output
814+ */
815+ $ data ['output ' ] = shell_exec ('zypper --non-interactive up ' );
794816 } else {
795817 /*
796818 * It is not Debian/Ubuntu, so there is no data and no state
You can’t perform that action at this time.
0 commit comments