pcp
[Top] [All Lists]

Re: [pcp] Help with Python API

To: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>, pcp@xxxxxxxxxxx
Subject: Re: [pcp] Help with Python API
From: Rohan Arora <rarora2012@xxxxxxxxx>
Date: Mon, 06 Jul 2015 17:51:53 +0000
Delivered-to: pcp@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-type; bh=pNKh3BUGP8wjC61Vd+J9wAyvLu0Drg73L9iQNJFYzQQ=; b=YyksWw2xbCgY41aFkoAHavdEutPw3eAlWI1zmcw6lMMmKxbhxcx7Vl/QSmz8rTaEWA nxER6d4OkiYqtqpsbPuoEbMYqPjPHXgMwht43FPM+puG9BZ8EtiRoKfRZWNb7bIJqBnF PNDY28El8OzjdXfvjrdA2MscDXN6s6Vgbwukcp0kuGZfYjrqCsd8NXkNxqdnS4GVZTZe 4pBv5GLcV6BD4c8DVxzBfR4XL9alolzbo9uCdGwkRjq6U25ZSu+SE+WAw6PaxafZOdpV doQ7Oy1sYRHcvRLqCMzMnul+a3px9RBntsVn7VIpzAnGOh42uKXJ0qfOYHERiW5G3t/f sIoA==
In-reply-to: <CANbxzdUn0Q8BkJUm-KAuTGxQAhQTz0CmSLdXEHKLT8UVKuBx4A@xxxxxxxxxxxxxx>
References: <CANbxzdXmsRFyF_J_7c93uBuKWJHZikoRs6xmSPQC91rALtZbNA@xxxxxxxxxxxxxx> <CANbxzdXGZosHkKZXrcvJMoaPb=2YOY7_Rhw6cs2y-vp0Jhj8Vg@xxxxxxxxxxxxxx> <CANbxzdXVmBE1qRoHQQTy9VvbAt4rqppwEL-xizSUH7cKOswNzQ@xxxxxxxxxxxxxx> <CANbxzdV7Vndvczvo9OLgc8CpQ20wBK=YUD6v87ewVBa6yrTXKQ@xxxxxxxxxxxxxx> <CANbxzdXcqg=sRYa0JwETB+RHChw42uAeZE-n+bABUjV-FD9TDg@xxxxxxxxxxxxxx> <587447889.27462536.1435530714712.JavaMail.zimbra@xxxxxxxxxx> <CANbxzdX_4yDiOBqU954wjfbKOFOXnB8SJ_uiRsKEBdUk-hxF1w@xxxxxxxxxxxxxx> <CANbxzdUHygK=0NuO7L3pV+FERXa-LRL59=sumY5TznT0xzonxg@xxxxxxxxxxxxxx> <337532723.28653925.1435618315696.JavaMail.zimbra@xxxxxxxxxx> <CANbxzdVqbstVAue-GKW5moDkkKJKeg5pvtRdg1eHNET_7dHxeQ@xxxxxxxxxxxxxx> <559466FE.8090107@xxxxxxxxxxxxxxxx> <CANbxzdXqUj3i-MR2xF_NrTkYV11MMLBCX0B-+Btt45JQa77NQA@xxxxxxxxxxxxxx> <CANbxzdUn0Q8BkJUm-KAuTGxQAhQTz0CmSLdXEHKLT8UVKuBx4A@xxxxxxxxxxxxxx>
For the program that I am writing, I want to be able to append an already existing archive, as the name is derived in a specific way, so I cannot name the archive something different if it is for the same host. However, I am taking the results for the previous x amount of hours, so I would like to be able to append to an existing archive. This would only be an issue if pmlogger is stopped and restarted. Currently, pmlogger is being started from a bash script file. Is there an option when starting pmlogger from the terminal to have it append to file "x" if it exists, else create it?

Thanks,
Rohan

On Mon, Jul 6, 2015 at 1:27 PM Rohan Arora <rarora2012@xxxxxxxxx> wrote:
Also, I see that in the pmSetMode() documentation, to read an archive in reverse order you use pmSetMode(PM_MODE_BACK, timeval, delta). The example gave the valueÂ0x7fffffff for timeval.tv_sec, but I was wondering, is that guaranteed to read from the end of the archive? In my case, I always just want to read the last x entries in the log.

Thanks,
Rohan

On Mon, Jul 6, 2015 at 12:50 PM Rohan Arora <rarora2012@xxxxxxxxx> wrote:
Hi,

Sorry I still haven't had a chance to really look at the issue with connecting pmlogger to a remote host yet, but in a previous e-mail, Nathan mentioned result->timestamp, which I'm assuming is the result you get from calling context.pmFetch(metric_ids), correct? How do I access this timestamp from Python? I want to put the timestamp for when a metric was fetched into a list of timestamps.

Thanks,
Rohan

On Wed, Jul 1, 2015 at 6:17 PM Ken McDonell <kenj@xxxxxxxxxxxxxxxx> wrote:
On 02/07/15 02:07, Rohan Arora wrote:
> I tried following the directions on that page, the telnet error that I
> get is "Connect failed" rather than "Connection refused". I have
> verified that pmcd is running on the host I am trying to connect to as
> it is shown as running as a service, and I am able to use pminfo as
> well. Does it matter that the host is protected using a putty private
> key when using ssh? I am not sure where to go from here really.

Are you able to use pminfo on the same system connecting to the remote pmcd (i.e. the same client-server arrangement where pmlogger is not working)? That would be odd.

In any event the following output would help diagnose ...

On the client system

$ pminfo -v -Dcontext -h <remotehost> disk.all
$ echo "log mandatory on once { disk.dev }" | pmlogger -Dcontext -h <remotehost> -l /dev/tty foobar
^C
$ pminfo -a foobar

And on the remote system, the contents of:

/etc/pcp/pmcd/pmcd.conf
/var/log/pcp/pmcd/pmcd.log

_______________________________________________
pcp mailing list
pcp@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/pcp
<Prev in Thread] Current Thread [Next in Thread>