Xymon Mailing List Archive search

Reference tag in hosts.cfg

6 messages in this thread

list Andy Smith · Fri, 10 Jan 2014 14:15:54 +0000 ·
Hi,

Could I request that this trivial change be added at some stage please.  It
introduces the ability to include a tag in hosts.cfg which has no purpose
other than provide an arbitary reference. eg

configdbid=12345

In my case '12345' would be the ID of a record in an asset database and I
can use this to construct a query that delivers useful support
information.  It could also be used the other way round and provide a way
to maintain hosts.cfg in a mysql db or some such.  Let me know what you
think.

*** xymon-code/lib/loadhosts.h.FCS      2014-01-10 11:29:26.000000000 +0000
--- xymon-code/lib/loadhosts.h  2014-01-10 14:00:51.000000000 +0000
***************
*** 55,60 ****
--- 55,61 ----
        XMH_FLAG_PULLDATA,
        XMH_FLAG_MULTIHOMED,
        XMH_LDAPLOGIN,
+       XMH_CONFIGDBID,
        XMH_IP,
        XMH_HOSTNAME,
        XMH_DOCURL,
*** xymon-code/lib/loadhosts.c.FCS      2014-01-10 11:29:26.000000000 +0000
--- xymon-code/lib/loadhosts.c  2014-01-10 14:00:42.000000000 +0000
***************
*** 170,175 ****
--- 170,177 ----
        xmh_item_name[XMH_FLAG_MULTIHOMED]     = "XMH_MULTIHOMED";
        xmh_item_key[XMH_LDAPLOGIN]            = "ldaplogin=";
        xmh_item_name[XMH_LDAPLOGIN]           = "XMH_LDAPLOGIN";
+       xmh_item_key[XMH_CONFIGDBID]           = "configdbid=";
+       xmh_item_name[XMH_CONFIGDBID]          = "XMH_CONFIGDBID";
        xmh_item_key[XMH_CLASS]                = "CLASS:";
        xmh_item_name[XMH_CLASS]               = "XMH_CLASS";
        xmh_item_key[XMH_OS]                   = "OS:";
*** xymon-code/web/svcstatus-info.c.FCS 2014-01-10 11:30:24.000000000 +0000
--- xymon-code/web/svcstatus-info.c     2014-01-10 14:01:27.000000000 +0000
***************
*** 1206,1211 ****
--- 1206,1212 ----
                     (strncmp(val, "type=", 5) == 0)    ||
                     (strncmp(val, "post=", 5) == 0)    ||
                     (strncmp(val, "nopost=", 7) == 0)  ||
+                    (strncmp(val, "configdbid=", 11) != 0)  &&
                     (strncmp(val, "soap=", 5) == 0)    ||
                     (strncmp(val, "nosoap=", 7) == 0)  ) {

Thanks
-- 
Andy
list Henrik Størner · Fri, 10 Jan 2014 17:37:00 +0100 ·
quoted from Andy Smith
Den 10-01-2014 15:15, Andy Smith skrev:
Hi,

Could I request that this trivial change be added at some stage please.
It introduces the ability to include a tag in hosts.cfg which has no
purpose other than provide an arbitary reference. eg

configdbid=12345

In my case '12345' would be the ID of a record in an asset database and
I can use this to construct a query that delivers useful support
information.  It could also be used the other way round and provide a
way to maintain hosts.cfg in a mysql db or some such.  Let me know what
you think.
Hmm ... hostnames are supposed to be a unique id for the servers in 
hosts.cfg - why can't you use that?


Regards,
Henrik
list John Thurston · Fri, 10 Jan 2014 08:11:47 -0900 ·
quoted from Andy Smith
On 1/10/2014 5:15 AM, Andy Smith wrote:
Could I request that this trivial change be added at some stage please.  It
introduces the ability to include a tag in hosts.cfg which has no purpose
other than provide an arbitary reference. eg

configdbid=12345
I don't understand the request. Isn't this function already here? I do this now with tags I've introduced into the hosts.cfg files for outside reference or ext scripts.

If you append the following to the end of a host line:
   configdbid:12345
don't you get exactly the behavior you seek? (Provided configdbid is not defined in protocols.cfg)

-- 
    Do things because you should, not just because you can.

John Thurston    XXX-XXX-XXXX
user-ce4d79d99bab@xymon.invalid
Enterprise Technology Services
Department of Administration
State of Alaska
list T.J. Yang · Fri, 10 Jan 2014 11:24:41 -0600 ·
quoted from Henrik Størner
On Fri, Jan 10, 2014 at 10:37 AM, Henrik Størner <user-ce4a2c883f75@xymon.invalid> wrote:
Den 10-01-2014 15:15, Andy Smith skrev:

 Hi,
Could I request that this trivial change be added at some stage please.
It introduces the ability to include a tag in hosts.cfg which has no
purpose other than provide an arbitary reference. eg

configdbid=12345

In my case '12345' would be the ID of a record in an asset database and
I can use this to construct a query that delivers useful support
information.  It could also be used the other way round and provide a
way to maintain hosts.cfg in a mysql db or some such.  Let me know what
you think.
Hmm ... hostnames are supposed to be a unique id for the servers in
hosts.cfg - why can't you use that?

I am in similar situation with Andy.  but I am looking a quick way to link
to other asset systems that doesn't use "asset name" but "asset id" for
searching.

My asset system has a web interface as
http://test.com/hostinfo?host=DatabaseID to display the asset information
of a hostname using numeric ID.
My current approach is to use hostinfo.csv + bit of code changes(R1) to
provide a one click away reach other data sources (like IBM BigFix, Ticket
System,  Puppet ...).


R1:
http://sourceforge.net/mailarchive/forum.php?thread_name=user-e639a182a5e3@xymon.invalid&forum_name=xymon-developer

May be above quick/easy hack will work for Andy's case. But this hack
 ditch the original purpose of hostinfo.csv.

I am hoping the asset URL link can be in "info" column as  a clickable
tag/link.
 this approach will save me some explanation on how to get to a xymon
host's other information.


tj

Regards,
Henrik

-- 
T.J. Yang
list T.J. Yang · Fri, 10 Jan 2014 11:46:52 -0600 ·
Hi John

Thanks for the pointer.
quoted from John Thurston

On Fri, Jan 10, 2014 at 11:11 AM, John Thurston <user-ce4d79d99bab@xymon.invalid>wrote:
On 1/10/2014 5:15 AM, Andy Smith wrote:
Could I request that this trivial change be added at some stage please.
 It
introduces the ability to include a tag in hosts.cfg which has no purpose
other than provide an arbitary reference. eg

configdbid=12345
I don't understand the request. Isn't this function already here? I do
this now with tags I've introduced into the hosts.cfg files for outside
reference or ext scripts.
I did a quick test on my xymon server, configdbid=12345 did show up under
"Other tags:".

Andy, is above result is what you need ?


Regards

tj
quoted from John Thurston
If you append the following to the end of a host line:
  configdbid:12345
don't you get exactly the behavior you seek? (Provided configdbid is not
defined in protocols.cfg)

--
   Do things because you should, not just because you can.

John Thurston    XXX-XXX-XXXX
user-ce4d79d99bab@xymon.invalid
Enterprise Technology Services
Department of Administration
State of Alaska

-- 

T.J. Yang
list John Thurston · Fri, 10 Jan 2014 09:00:33 -0900 ·
On 1/10/2014 8:24 AM, T.J. Yang wrote:
- snip -
quoted from T.J. Yang
I am in similar situation with Andy.  but I am looking a quick way to link
to other asset systems that doesn't use "asset name" but "asset id" for
searching.
- snip -
quoted from T.J. Yang
I am hoping the asset URL link can be in "info" column as  a clickable
tag/link.
The unique hostname isn't directly accessible for links on the 'info' page, but it can be had in a round-about way. I embed HTML in the DESCR field to provide this external linkage on the 'info' page of Xymon. Like this:
DESCR:"Router:<a href=/xymon/extnotes/legacynotes.php target=_blank >Legacy Notes</a>"
My legacynotes.php looks in $_SERVER['HTTP_REFERER'] to find the parameter 'HOST=foo.bar.com' which it then uses to craft an appropriate 302 message sending the customer to an external application. If the external ID for your application were in the hosts.cfg in an arbitrary (ignored) tag, the php could pull it out and use it to craft an appropriate 302.
quoted from T.J. Yang

-- 
    Do things because you should, not just because you can.

John Thurston    XXX-XXX-XXXX
user-ce4d79d99bab@xymon.invalid
Enterprise Technology Services
Department of Administration
State of Alaska