[Nagios-users] My Own Plugin Issues

2013-04-17 Thread Net Warrior
Hi guys.
I tried to create my own plugin to check disk space and I'm almost done
except that the plugin is not returning the expected data:
If i run the plugn from the command line I get:

/usr/lib/nagios/plugins/check_diskl.sh 80 90 /home
Critical  Disk Space /home - Total: 985M - Usado: 970M - Libre 0

But from nagios I get:
 free space: /home 0 MB (0% inode=94%): Do not know where on earth the
inode information is taken from and is not the format expected I want this:

Critical  Disk Space /home - Total: 985M - Usado: 970M - Libre 0


My script ends with
echo $RESULT
exit 0;

Where result is:
RESULT="$NOMBREDIR  Total: $ESPACIOTOTAL  Usado: $ESPACIOUSADO  Libre
$ESPACIOLIBRE"

This is the final part :
-- snip---

if [  "$PORCENTAJE" -ge "$CRIT"  ]; then
echo "Critical $RESULT";
exit 2;
fi

if [ "$PORCENTAJE" -ge "$WARN" ]; then
echo "Warning  $RESULT";
exit 1;
fi

echo $RESULT
exit 0;


I'm ai missing something else?

Any advice really appreciated
Thanks
Regards
--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter___
Nagios-users mailing list
Nagios-users@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

Re: [Nagios-users] Receiving mail alert for failed services

2013-04-17 Thread Sunil Sankar
Make sure you have sendmail or postfix configured to do so ;)

On Wed, Apr 17, 2013 at 3:00 PM, Zama Ques  wrote:

> ok...We need to configure a mail agent also . Let me do that and will get
> back here  if it does not work/further doubts.
> Thanks for the help .
>
> Thanks
> Zaman
>   --
>  *From:* FTL Nagios 
> *To:* 'Zama Ques' ; 'Nagios Users List' <
> nagios-users@lists.sourceforge.net>
> *Sent:* Wednesday, 17 April 2013 2:51 PM
> *Subject:* RE: [Nagios-users] Receiving mail alert for failed services
>
> Have you set us Postfix or other such mail agent to actually send the mail?
>
> *From:* Zama Ques [mailto:quesz...@yahoo.in]
> *Sent:* 17 April 2013 08:01
> *To:* nagios-users@lists.sourceforge.net
> *Subject:* [Nagios-users] Receiving mail alert for failed services
>
> Hi All ,
>
>
> I was trying to configure to send alert mails for failed services in
> Nagios . For this , I tried the following configuration
>
> =
>  /usr/local/nagios/etc/objects/contacts.cfg
>
> define contact{
> contact_namezamanl  ; Short
> name of user
> use  generic-contact ;
> Inherit default values from generic-contact template (defined above)
> aliasNagios Admin;
> Full name of user
>
> email  za...@server.example.com   
> ; <<* CHANGE THIS TO YOUR EMAIL ADDRESS **
> }
>
>
> define contactgroup{
> contactgroup_name   nagiosadmins
> alias Nagios Administrators
> members zamanl
> }
>
>
> Restarted nagios service without any errors and it looks like
> notifications are generated for failed services by looking at system log
> file
>
>
> [@server ~]# tail -f /var/log/messages
> Apr 17 11:26:52 server nagios: SERVICE NOTIFICATION: zamanl;mgthost;Total
> Processes;CRITICAL;notify-service-by-email;PROCS CRITICAL: 312 processes
> Apr 17 11:27:22 server nagios: SERVICE NOTIFICATION: zamanl;host1;Total
> Processes;CRITICAL;notify-service-by-email;PROCS CRITICAL: 313 processes
> Apr 17 11:27:22 server nagios: SERVICE NOTIFICATION: zamanl;host2;Total
> Processes;CRITICAL;notify-service-by-email;PROCS CRITICAL: 313 processes
>
> But I have not received any mail messages for the notification .
>
> [@server ~]$ id
> uid=501(zaman) gid=501(zaman) groups=501(zaman)
> [@server ~]# mail
> No mail for zaman
> [@server ~]# hostname
> server.example.com
>
> Kindly suggest what needs to be done to receive alert mail for failed
> services ?
>
> Any help will be highly appreciated .
>
> Thanks
> Zaman
>
>
>
>
> --
> Precog is a next-generation analytics platform capable of advanced
> analytics on semi-structured data. The platform includes APIs for building
> apps and a phenomenal toolset for data science. Developers can use
> our toolset for easy data analysis & visualization. Get a free account!
> http://www2.precog.com/precogplatform/slashdotnewsletter
> ___
> Nagios-users mailing list
> Nagios-users@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
>



-- 
Regards
Sunil Sankar
--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter___
Nagios-users mailing list
Nagios-users@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

Re: [Nagios-users] Receiving mail alert for failed services

2013-04-17 Thread Zama Ques
ok...We need to configure a mail agent also . Let me do that and will get back 
here  if it does not work/further doubts. 

Thanks for the help .


Thanks
Zaman



 From: FTL Nagios 
To: 'Zama Ques' ; 'Nagios Users List' 
 
Sent: Wednesday, 17 April 2013 2:51 PM
Subject: RE: [Nagios-users] Receiving mail alert for failed services
 


Have you set us Postfix or other such mail agent to actually send the mail?
 
From:Zama Ques [mailto:quesz...@yahoo.in] 
Sent: 17 April 2013 08:01
To: nagios-users@lists.sourceforge.net
Subject: [Nagios-users] Receiving mail alert for failed services
 
Hi All ,
 
 
I was trying to configure to send alert mails for failed services in Nagios . 
For this , I tried the following configuration
 
=
 /usr/local/nagios/etc/objects/contacts.cfg 
 
define contact{
    contact_name    zamanl  ; Short name of 
user
    use              generic-contact ; 
Inherit default values from generic-contact template (defined above)
    alias            Nagios Admin    ; Full 
name of user

    email          za...@server.example.com    
; <<* CHANGE THIS TO YOUR EMAIL ADDRESS **
    }
 
 
define contactgroup{
    contactgroup_name   nagiosadmins
    alias                     Nagios Administrators
    members zamanl
    }
 
 
Restarted nagios service without any errors and it looks like notifications are 
generated for failed services by looking at system log file
 
 
[@server ~]# tail -f /var/log/messages
Apr 17 11:26:52 server nagios: SERVICE NOTIFICATION: zamanl;mgthost;Total 
Processes;CRITICAL;notify-service-by-email;PROCS CRITICAL: 312 processes
Apr 17 11:27:22 server nagios: SERVICE NOTIFICATION: zamanl;host1;Total 
Processes;CRITICAL;notify-service-by-email;PROCS CRITICAL: 313 processes
Apr 17 11:27:22 server nagios: SERVICE NOTIFICATION: zamanl;host2;Total 
Processes;CRITICAL;notify-service-by-email;PROCS CRITICAL: 313 processes

But I have not received any mail messages for the notification .
 
[@server ~]$ id
uid=501(zaman) gid=501(zaman) groups=501(zaman)
[@server ~]# mail
No mail for zaman
[@server ~]# hostname 
server.example.com
 
Kindly suggest what needs to be done to receive alert mail for failed services 
? 
 
Any help will be highly appreciated .
 
Thanks
Zaman--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter___
Nagios-users mailing list
Nagios-users@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

Re: [Nagios-users] Receiving mail alert for failed services

2013-04-17 Thread FTL Nagios
Have you set us Postfix or other such mail agent to actually send the mail?

 

From: Zama Ques [mailto:quesz...@yahoo.in] 
Sent: 17 April 2013 08:01
To: nagios-users@lists.sourceforge.net
Subject: [Nagios-users] Receiving mail alert for failed services

 

Hi All ,

 

 

I was trying to configure to send alert mails for failed services in Nagios
. For this , I tried the following configuration

 

=

 /usr/local/nagios/etc/objects/contacts.cfg 

 

define contact{
contact_namezamanl  ; Short name
of user
use  generic-contact ;
Inherit default values from generic-contact template (defined above)
aliasNagios Admin;
Full name of user

email  za...@server.example.com
 ; <<* CHANGE THIS TO YOUR
EMAIL ADDRESS **
}

 

 

define contactgroup{
contactgroup_name   nagiosadmins
alias Nagios Administrators
members zamanl
}

 

 

Restarted nagios service without any errors and it looks like notifications
are generated for failed services by looking at system log file

 

 

[@server ~]# tail -f /var/log/messages
Apr 17 11:26:52 server nagios: SERVICE NOTIFICATION: zamanl;mgthost;Total
Processes;CRITICAL;notify-service-by-email;PROCS CRITICAL: 312 processes
Apr 17 11:27:22 server nagios: SERVICE NOTIFICATION: zamanl;host1;Total
Processes;CRITICAL;notify-service-by-email;PROCS CRITICAL: 313 processes
Apr 17 11:27:22 server nagios: SERVICE NOTIFICATION: zamanl;host2;Total
Processes;CRITICAL;notify-service-by-email;PROCS CRITICAL: 313 processes

But I have not received any mail messages for the notification .

 

[@server ~]$ id
uid=501(zaman) gid=501(zaman) groups=501(zaman)
[@server ~]# mail
No mail for zaman
[@server ~]# hostname 
server.example.com

 

Kindly suggest what needs to be done to receive alert mail for failed
services ? 

 

Any help will be highly appreciated .

 

Thanks

Zaman

--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter___
Nagios-users mailing list
Nagios-users@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

[Nagios-users] Receiving mail alert for failed services

2013-04-17 Thread Zama Ques
Hi All ,


I was trying to configure to send alert mails for failed services in Nagios . 
For this , I tried the following configuration

=

 /usr/local/nagios/etc/objects/contacts.cfg 


define contact{
    contact_name    zamanl  ; Short name of 
user
    use              generic-contact ; 
Inherit default values from generic-contact template (defined above)
    alias            Nagios Admin    ; Full 
name of user

    email          za...@server.example.com    
; <<* CHANGE THIS TO YOUR EMAIL ADDRESS **
    }


define contactgroup{
    contactgroup_name   nagiosadmins
    alias                     Nagios Administrators
    members zamanl
    }



Restarted nagios service without any errors and it looks like notifications are 
generated for failed services by looking at system log file


[@server ~]# tail -f /var/log/messages
Apr 17 11:26:52 server nagios: SERVICE NOTIFICATION: zamanl;mgthost;Total 
Processes;CRITICAL;notify-service-by-email;PROCS CRITICAL: 312 processes
Apr 17 11:27:22 server nagios: SERVICE NOTIFICATION: zamanl;host1;Total 
Processes;CRITICAL;notify-service-by-email;PROCS CRITICAL: 313 processes
Apr 17 11:27:22 server nagios: SERVICE NOTIFICATION: zamanl;host2;Total 
Processes;CRITICAL;notify-service-by-email;PROCS CRITICAL: 313 processes

But I have not received any mail messages for the notification .

[@server ~]$ id
uid=501(zaman) gid=501(zaman) groups=501(zaman)
[@server ~]# mail
No mail for zaman
[@server ~]# hostname 
server.example.com

Kindly suggest what needs to be done to receive alert mail for failed services 
? 


Any help will be highly appreciated .

Thanks
Zaman
--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter___
Nagios-users mailing list
Nagios-users@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