"total cpu" gives syntax error

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

"total cpu" gives syntax error

Roland Giesler
I can't figure out why this line gives an error.

check system secure.xxx.com
    if total cpu > 95% for 10 cycles then alert

Neither the above, nor the one below works.

 if cpu > 95% for 10 cycles then alert

Running version:
# monit -V
This is Monit version 5.26.0
Built with ssl, with ipv6, with compression, with pam and with large files
Copyright (C) 2001-2019 Tildeslash Ltd. All Rights Reserved.

The documentation at https://mmonit.com/monit/documentation/monit.html#Process says that his is correct, but the service gives:

 * Starting daemon monitor monit
/etc/monit/monitrc:100: syntax error 'total cpu'

Roland

--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general
Reply | Threaded
Open this post in threaded view
|

Re: "total cpu" gives syntax error

Lutz Mader
Hello,
you are using "check system", but "total cpu" is in the sub chapter
"Process resource tests".

> TOTAL CPU is the total CPU usage of the process and its children in
> (percent). You will want to use TOTAL CPU typically for services like
> Apache web server where one master process forks child processes as
> workers. Example:
>
>  if total cpu > 50% for 10 cycles then restart

The "check system" check use "cpu usage", see sub chapter "System
resource tests"

With regards,
Lutz

p.s.
See https://mmonit.com/monit/documentation/monit.html#System-resource-tests
but not
https://mmonit.com/monit/documentation/monit.html#Process-resource-tests

--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general
Reply | Threaded
Open this post in threaded view
|

Re: "total cpu" gives syntax error

Roland Giesler

On Wed, Jul 17, 2019 at 10:15 PM Lutz Mader <[hidden email]> wrote:

The "check system" check use "cpu usage", see sub chapter "System
resource tests"

Ah, it's becoming clearer and my problem is resolved.  Thank you!
 

With regards,
Lutz

p.s.
See https://mmonit.com/monit/documentation/monit.html#System-resource-tests
but not
https://mmonit.com/monit/documentation/monit.html#Process-resource-tests

--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general
Reply | Threaded
Open this post in threaded view
|

Re: "total cpu" gives syntax error

Szépe Viktor
Idézem/Quoting Roland Giesler <[hidden email]>:

> On Wed, Jul 17, 2019 at 10:15 PM Lutz Mader <[hidden email]> wrote:
>
>>
>> The "check system" check use "cpu usage", see sub chapter "System
>> resource tests"
>>
>
> Ah, it's becoming clearer and my problem is resolved.  Thank you!
>
>
>>
>> With regards,
>> Lutz

Hi Roland!

See this living collection of Monit configs
https://github.com/szepeviktor/debian-server-tools/blob/master/monitoring/monit/services/01-system#L2-L4



SZÉPE Viktor, webes alkalmazás üzemeltetés / Running your application
https://github.com/szepeviktor/debian-server-tools/blob/master/CV.md
~~~
ügyelet/hotline: +36-20-4242498  [hidden email]  skype: szepe.viktor
Budapest, III. kerület






Reply | Threaded
Open this post in threaded view
|

Re: "total cpu" gives syntax error

Roland Giesler
On Thu, Jul 18, 2019 at 1:30 PM SZÉPE Viktor <[hidden email]> wrote:
Idézem/Quoting Roland Giesler <[hidden email]>:

Hi Roland!

See this living collection of Monit configs
https://github.com/szepeviktor/debian-server-tools/blob/master/monitoring/monit/services/01-system#L2-L4

Excellent!  Where can I find the server-integrity.sh script that you use there?





SZÉPE Viktor, webes alkalmazás üzemeltetés / Running your application
https://github.com/szepeviktor/debian-server-tools/blob/master/CV.md
~~~
ügyelet/hotline: +36-20-4242498  [hidden email]  skype: szepe.viktor
Budapest, III. kerület






Reply | Threaded
Open this post in threaded view
|

Re: "total cpu" gives syntax error

Szépe Viktor
Idézem/Quoting Roland Giesler <[hidden email]>:

> On Thu, Jul 18, 2019 at 1:30 PM SZÉPE Viktor <[hidden email]> wrote:
>
>> Idézem/Quoting Roland Giesler <[hidden email]>:
>>
>> Hi Roland!
>>
>> See this living collection of Monit configs
>>
>> https://github.com/szepeviktor/debian-server-tools/blob/master/monitoring/monit/services/01-system#L2-L4
>> <https://mailtrack.io/trace/link/6c4be0db8085722c0856c144ac705bb982a90637?url=https%3A%2F%2Fgithub.com%2Fszepeviktor%2Fdebian-server-tools%2Fblob%2Fmaster%2Fmonitoring%2Fmonit%2Fservices%2F01-system%23L2-L4&userId=977006&signature=ac60cfe0bbd4981f>
>
>
> Excellent!  Where can I find the server-integrity.sh script that you use
> there?

There is an auto-install script in the parent folder:  
monit-debian-setup.sh it does @@templating@@
Please consider reading its source.

*_script are shell scripts to be installed
*_preinst generates default values during installation
*_postinst does some checking

All Monit configs are names after Debian packages, except numbered ones.

All the best to you!


ps. GitHub has a search feature
https://github.com/szepeviktor/debian-server-tools/search?q=server-integrity.sh&unscoped_q=server-integrity.sh



SZÉPE Viktor, webes alkalmazás üzemeltetés / Running your application
https://github.com/szepeviktor/debian-server-tools/blob/master/CV.md
~~~
ügyelet/hotline: +36-20-4242498  [hidden email]  skype: szepe.viktor
Budapest, III. kerület






Reply | Threaded
Open this post in threaded view
|

Re: "total cpu" gives syntax error

Roland Giesler
On Thu, Jul 18, 2019 at 3:02 PM SZÉPE Viktor <[hidden email]> wrote:

There is an auto-install script in the parent folder: 
monit-debian-setup.sh it does @@templating@@
Please consider reading its source.

*_script are shell scripts to be installed
*_preinst generates default values during installation
*_postinst does some checking

All Monit configs are names after Debian packages, except numbered ones.

All the best to you!

Thanks again, I'll do that.
 

ps. GitHub has a search feature
https://github.com/szepeviktor/debian-server-tools/search?q=server-integrity.sh&unscoped_q=server-integrity.sh

Indeed, that is the very first thing I did to try to find the script :-)
 




SZÉPE Viktor, webes alkalmazás üzemeltetés / Running your application
https://github.com/szepeviktor/debian-server-tools/blob/master/CV.md
~~~
ügyelet/hotline: +36-20-4242498  [hidden email]  skype: szepe.viktor
Budapest, III. kerület






Reply | Threaded
Open this post in threaded view
|

Re: "total cpu" gives syntax error

Roland Giesler
On Thu, Jul 18, 2019 at 3:43 PM Roland Giesler <[hidden email]> wrote:
On Thu, Jul 18, 2019 at 3:02 PM SZÉPE Viktor <[hidden email]> wrote:

There is an auto-install script in the parent folder: 
monit-debian-setup.sh it does @@templating@@
Please consider reading its source.

Hi Victor

I'm clearly not at the level where I can figure out exactly what happens in your script.  Most of it seems straight forward, but how server-integrity.sh is created is not clear to me.  It it part of

DEBIAN_SERVER_TOOLS_INSTALLER="../../install.sh"

by any chance? 


*_script are shell scripts to be installed
*_preinst generates default values during installation
*_postinst does some checking

All Monit configs are names after Debian packages, except numbered ones.

All the best to you!

Thanks again, I'll do that.
 

ps. GitHub has a search feature
https://github.com/szepeviktor/debian-server-tools/search?q=server-integrity.sh&unscoped_q=server-integrity.sh

Indeed, that is the very first thing I did to try to find the script :-)
 




SZÉPE Viktor, webes alkalmazás üzemeltetés / Running your application
https://github.com/szepeviktor/debian-server-tools/blob/master/CV.md
~~~
ügyelet/hotline: +36-20-4242498  [hidden email]  skype: szepe.viktor
Budapest, III. kerület






image.gif
Reply | Threaded
Open this post in threaded view
|

Re: "total cpu" gives syntax error

Szépe Viktor
Idézem/Quoting Roland Giesler <[hidden email]>:

> On Thu, Jul 18, 2019 at 3:43 PM Roland Giesler <[hidden email]>
> wrote:
>
>> On Thu, Jul 18, 2019 at 3:02 PM SZÉPE Viktor <[hidden email]> wrote:
>>
>>>
>>> There is an auto-install script in the parent folder:
>>> monit-debian-setup.sh it does @@templating@@
>>> Please consider reading its source.
>>>
>>
> Hi Victor
>
> I'm clearly not at the level where I can figure out exactly what happens in
> your script.  Most of it seems straight forward, but how
> server-integrity.sh is created is not clear to me.  It it part of
>
> DEBIAN_SERVER_TOOLS_INSTALLER="../../install.sh"
>
> by any chance?

This repo shows how I install webservers.
Here we call install.sh
https://github.com/szepeviktor/debian-server-tools/blob/master/monitoring/monit/monit-debian-setup.sh#L107-L110
If you start monit-debian-setup.sh within the repo then  
../../install.sh will exist.
install.sh is the general script installer, it works from the meta headers
"# FIELD            :VALUE" of a given script.
See the packing readme  
https://github.com/szepeviktor/debian-server-tools/blob/master/package/README.md#script-meta


monit-debian-setup.sh installs and sets up Monit completely.
If you got all values at hand it takes 2 minutes.



SZÉPE Viktor, webes alkalmazás üzemeltetés / Running your application
https://github.com/szepeviktor/debian-server-tools/blob/master/CV.md
~~~
ügyelet/hotline: +36-20-4242498  [hidden email]  skype: szepe.viktor
Budapest, III. kerület