Nagios memory percentages

Machiel Richards MachielR at agilitytech.co.za
Tue Mar 11 14:45:17 CET 2008


Hi everyone

  Thank you for all the help

    I also now need to know the following :

   I have now managed to get the memory usage working where it provides the percentage as output and this is then used for monitoring innagios.
      


    However, the only 'message' displayed on the Nagios screen for the monitoring is the percentage and that is basically all...

   How can I still get this message to be a bit more user friendly without breaking the monitoring part?

 

-----Original Message-----


*** Disclaimer ***

The information contained in this e-mail is confidential and legally privileged and is intended solely for the addressee and to others who have the authority to receive it. Access to this e-mail by anyone else is unauthorized and as such, any disclosure, copying, distribution or any action taken or omitted in reliance on it is unlawful. If you have received this e-mail in error, please notify the sender immediately.

The views expressed in this e-mail are the views of the individual sender and should in no way be construed as the views of the Company.

The Company is not liable to ensure that outgoing e-mails are virus-free.

The Company is not liable, should information or data, for whatever reason, be corrupted or fail to reach its intended addressee.

The Company is not liable for any loss or damage of whatsoever nature and howsoever arising resulting from the opening or the use of the information in this e-mail, including its attachments and links.

The sender of this e-mail is subject to and bound by the terms and conditions of Company+IBk-s Electronic Communications Usage Policy.

From: Lars Stavholm [mailto:stava at telcotec.se]=20
Sent: Tuesday, March 11, 2008 3:42 PM
To: Machiel Richards
Cc: nagios-users at lists.sourceforge.net
Subject: Re: [Nagios-users] Nagios memory percentages

$ cat /proc/meminfo | awk '{print $2}'

On Tue, Mar 11, 2008 at 03:33:22PM +0200, Machiel Richards wrote:
> Thanks a lot, now I've learned something new...
>=20
> This works perfectly.
>=20
> -----Original Message-----
> From: Giles Coochey [mailto:gcoochey at sapphire.gi]=20
> Sent: Tuesday, March 11, 2008 2:59 PM
> To: Machiel Richards; nagios-users at lists.sourceforge.net
> Subject: RE: [Nagios-users] Nagios memory percentages
>=20
> Perhaps, rather than cut, try grep -o '[0-9][0-9]*'
>=20
> ________________________________________
> From: nagios-users-bounces at lists.sourceforge.net [mailto:nagios-users-bou=
nces at lists.sourceforge.net] On Behalf Of Machiel Richards
> Sent: 11 March 2008 13:41
> To: nagios-users at lists.sourceforge.net
> Subject: Re: [Nagios-users] Nagios memory percentages
>=20
> Hi
>=20
> =A0 I am trying to use this option but the issue I have now is with the f=
ollowing:
>=20
> The output from the /proc/meminfo is=A0 as follows:
>=20
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 MemFree:=A0=A0=A0=A0=A0 206788 kB
>=20
> =A0=A0 However, when I try to use cut in order to only get the numeric va=
lue, the output I get back does not work that well as it still includes the=
 <spaces> infront of the numeric value as well as the kb at the end...
>=20
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 I have even tried this with free and th=
e same result....
>=20
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 What should I use as delimiter to the c=
ut command?
>=20
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Any other suggestions on how to only ge=
t the numeric value?
>=20
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Commands used with output:
>=20
> cat /proc/meminfo | grep MemTotal | cut -f 2 -d ":"
>=20
> output :
>=20
> =A0=A0=A0=A0=A0 2067884 kB
>=20
>=20
> =A0 As you can see the spaces are all out of place.....
>=20
> =A0=A0=A0=A0=A0 I have also noticed that when using a space as delimiter =
and counting the spaces to the value, then you get the result, however if t=
he numeric value increase by one digit (i.e. from 6 digits to 7 digits for =
instance) then the amount of spaces change and the program does not work.
>=20
>=20
>=20
>=20
> ________________________________________
> From: nagios-users-bounces at lists.sourceforge.net [mailto:nagios-users-bou=
nces at lists.sourceforge.net] On Behalf Of Dale J. Chatham
> Sent: Tuesday, March 11, 2008 1:15 PM
> To: Machiel Richards
> Cc: nagios-users at lists.sourceforge.net
> Subject: Re: [Nagios-users] Nagios memory percentages
>=20
> Looc at the /proc/meminfo file and the vmstat command.
>=20
> Divide memory parameter (free, used, whatever) by total memory, multiply =
by 100 and you have percent.
>=20
> Machiel Richards wrote:=20
> Hi Everyone
> =A0
> =A0 Maybe someone can assist me, but this may be a more linux specific qu=
estion than Nagios even though related to Nagios.
> =A0
> =A0=A0 I need to monitor the memory usage in percentage on Nagios and wou=
ld like to rather write my own scripts for this.
> =A0
> =A0
> =A0=A0 I know there are snmp versions of this to do the job for me, howev=
er I do not want to complicate the systems with too many clients running on=
 them.
> =A0
> Currently we are using the normal nrpe to connect to the systems and run =
scripts remotely, however we do not have one to monitor the memory.
> =A0
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 On the web there are a lot of reference=
s to the snmp commands but as all the systems are production and we might b=
e having a couple of upgrades soon, I would like to rather keep it simple a=
nd only run one client on it for all Nagios connections.
> =A0
> =A0
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 My question is this... I can use the co=
mmand free to get the amount of memory , used, free etc...=20
> =A0
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 How can I write this into a script to d=
isplay as percentages... is there another command I can use or maybe an opt=
ion that I do not know about?
> =A0
> tx
> *** Disclaimer ***=20
> The information contained in this e-mail is confidential and legally priv=
ileged and is intended solely for the addressee and to others who have the =
authority to receive it. Access to this e-mail by anyone else is unauthoriz=
ed and as such, any disclosure, copying, distribution or any action taken o=
r omitted in reliance on it is unlawful. If you have received this e-mail i=
n error, please notify the sender immediately.=20
> The views expressed in this e-mail are the views of the individual sender=
 and should in no way be construed as the views of the Company.=20
> The Company is not liable to ensure that outgoing e-mails are virus-free.=
=20
> The Company is not liable, should information or data, for whatever reaso=
n, be corrupted or fail to reach its intended addressee.=20
> The Company is not liable for any loss or damage of whatsoever nature and=
 howsoever arising resulting from the opening or the use of the information=
 in this e-mail, including its attachments and links.=20
> The sender of this e-mail is subject to and bound by the terms and condit=
ions of Company's Electronic Communications Usage Policy.=20
>=20
>=20
>=20
>=20
>=20
> ________________________________________
>=20
>=20
>=20
>=20
>=20
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>=20
>=20
>=20
>=20
>=20
> ________________________________________
>=20
>=20
>=20
>=20
>=20
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> ::: Please include Nagios version, plugin version (-v) and OS when report=
ing any issue.=20
> ::: Messages without supporting info will risk being sent to /dev/null
>=20
> *** Disclaimer ***=20
> The information contained in this e-mail is confidential and legally priv=
ileged and is intended solely for the addressee and to others who have the =
authority to receive it. Access to this e-mail by anyone else is unauthoriz=
ed and as such, any disclosure, copying, distribution or any action taken o=
r omitted in reliance on it is unlawful. If you have received this e-mail i=
n error, please notify the sender immediately.=20
> The views expressed in this e-mail are the views of the individual sender=
 and should in no way be construed as the views of the Company.=20
> The Company is not liable to ensure that outgoing e-mails are virus-free.=
=20
> The Company is not liable, should information or data, for whatever reaso=
n, be corrupted or fail to reach its intended addressee.=20
> The Company is not liable for any loss or damage of whatsoever nature and=
 howsoever arising resulting from the opening or the use of the information=
 in this e-mail, including its attachments and links.=20
> The sender of this e-mail is subject to and bound by the terms and condit=
ions of Company's Electronic Communications Usage Policy.=20
>=20
>=20
> *** Disclaimer ***
>=20
> The information contained in this e-mail is confidential and legally priv=
ileged and is intended solely for the addressee and to others who have the =
authority to receive it. Access to this e-mail by anyone else is unauthoriz=
ed and as such, any disclosure, copying, distribution or any action taken o=
r omitted in reliance on it is unlawful. If you have received this e-mail i=
n error, please notify the sender immediately.
>=20
> The views expressed in this e-mail are the views of the individual sender=
 and should in no way be construed as the views of the Company.
>=20
> The Company is not liable to ensure that outgoing e-mails are virus-free.
>=20
> The Company is not liable, should information or data, for whatever reaso=
n, be corrupted or fail to reach its intended addressee.
>=20
> The Company is not liable for any loss or damage of whatsoever nature and=
 howsoever arising resulting from the opening or the use of the information=
 in this e-mail, including its attachments and links.
>=20
> The sender of this e-mail is subject to and bound by the terms and condit=
ions of Company's Electronic Communications Usage Policy.
>=20

> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> ::: Please include Nagios version, plugin version (-v) and OS when report=
ing any issue.=20
> ::: Messages without supporting info will risk being sent to /dev/null

--=20
Lars.Stavholm at telcotec.se   Telcotec Sweden AB
 phone: +46 (0)31  216404   Norra Gubberogatan 30
mobile: +46 (0)705 606498   416 63 Gothenburg, Sweden
   fax: +46 (0)31  216404   http://www.telcotec.se

-------------- next part --------------
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
-------------- next part --------------
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null


More information about the Users mailing list