Operating System - HP-UX
1748182 Members
3543 Online
108759 Solutions
New Discussion юеВ

Re: Does HP-UX provide an API to LVM, ioscan, cm* ?

 
SOLVED
Go to solution
Ralph Grothe
Honored Contributor

Does HP-UX provide an API to LVM, ioscan, cm* ?

See subject.

Regards
Ralph
Madness, thy name is system administration
7 REPLIES 7
Christopher Caldwell
Honored Contributor

Re: Does HP-UX provide an API to LVM, ioscan, cm* ?

From an interrogation standpoint, use the pstat(2) system call.

From a provisioning standpoint, I'd wrap the existing 1m commands.

H.Merijn Brand (procura
Honored Contributor
Ralph Grothe
Honored Contributor

Re: Does HP-UX provide an API to LVM, ioscan, cm* ?

Hello Merijn,

I already knew the mentioned HPUX modules,
but I don't want to use them since they are not much different from mine.
These modules (like mine) only parse the output of the vg|lv|pvdisplay, ioscan commands to put it in a LoL.
Whereas I would rather prefer to have a more direct access through an API library (probably in C) for three reasons.
First, I don't want to modify my modules whenever the output format of the above mentioned commands changes.
2nd, I guess it is a bit faster, and leaves you a greater degree of control.
3rd, I want to play a bit with creating a module that embeds C because I recently bought the book "Extending and Embedding Perl" by Cozens and Jennes,
that whet my appetite.
Madness, thy name is system administration
Jean-Louis Phelix
Honored Contributor
Solution

Re: Does HP-UX provide an API to LVM, ioscan, cm* ?

Hi,

For LVM and ServiceGuard, the answer is clearly NO. I'm from HP and I wrote a lot of tools around system admin, but never succeeded in getting such APIs ...

For ioscan, it's possible to read /etc/ioconfig file using struct defined in /usr/include/sys/ioparams.h. Have a look to union ioconfig_record for example.

Regards.
It works for me (┬й Bill McNAMARA ...)
Christopher Caldwell
Honored Contributor

Re: Does HP-UX provide an API to LVM, ioscan, cm* ?

>Whereas I would rather prefer to have a more direct access through an API library (probably in C) for three reasons.

If that's the case (I'm assuming you're reading), then pstat is exactly what you want (it's C).

H.Merijn Brand (procura
Honored Contributor

Re: Does HP-UX provide an API to LVM, ioscan, cm* ?

OK, clear. First of all I wish you a lot of fun. Really! The book is good. I've had a few glimpses through it in Munchen.

If you think XS is too hard to start with, try Inline::C first. Very easy interface, immediate results.
Enjoy, Have FUN! H.Merijn
Ralph Grothe
Honored Contributor

Re: Does HP-UX provide an API to LVM, ioscan, cm* ?

Christopher,

that was a good hint.
I had a look at man pstat and the pstat.h header file to see that it offers amongst others get_lvinfo() and get_diskinfo().
Maybe that's already enough to get me starting.
Unfortunately I lack an HP-UX workstation at home for development, and I don't seem to find time to do this sort of playing at work :-(
Madness, thy name is system administration