Define our own macros

James Kingston james.kingston at gmail.com
Wed Jul 7 17:04:38 CEST 2004


To be honest, I don't see why you can't use servicedesc

For example, you are using check_tcp to check for amanda on port
10080.  You can set your servicedesc as "amanda", "amanda_on_10080",
or "tcp_port_10080"

If you must go to the source:
the service struct is defined in objects.h, IIRC
grab_service_macros() is in utils.c, and it is called immediately
before every service notification.  You can probably fill the
information you would like to add into one of the $USERn$ macros,
which come from the macro_user[] array originally defined in nagios.c

Good luck.



On Wed, 7 Jul 2004 16:28:09 +0200, Marco Borsani <m.borsani at it.net> wrote:
> 
> I did not miss his solution, as you can read in my first e-mail I already
> know that possibility.
> 
> As I wrote I can't follow that way so I have to find another one.
> 
> I am tring to modify/add some informations given by nagios (macros?),
> looking for source file and .h file...actually I don't find anything yet.
> regards
> 
> Marco
> 
> -----Messaggio originale-----
> Da: James Kingston [mailto:james.kingston at gmail.com]
> Inviato: mercoledi 7 luglio 2004 16.21
> A: Marco Borsani
> Oggetto: Re: [Nagios-users] Define our own macros
> 
> I think you missed Andreas Ericsson's solution when you last asked
> (pasted below):
> 
> --------------------------------------------------------
> Marco Borsani wrote:
> > Hi everybody !
> >
> > I have following problem with my technicians.
> >
> > I have many check_tcp on same host. When CRITICAL messages arrive (via
> > epager or via mail) the technicians can't see which ports have problems
> > because the only information that they read is:
> > "Socket timeout after 10 seconds"
> > We have not the same problem when they receive OK messages because in that
> > kind of messages NAGIOS write the port number:
> > "TCP OK - 0.012 second response time on port 8080"
> >
> > Actually I can't modify "service name" (that could solve this problem
> > putting the port number inside it!), have you got any idea about this
> > situation?
> >
> 
> Just out of curiousity, why can't you change the service_description
> variable? It's there for the sole purpose of identifying the service to
> nagios AND the technicians.
> 
> > Regards
> >
> > Marco
> 
>


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
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