How-to
Automate daily PI message log collection with pigetmsg
Short answer
Query each PI Data Archive remotely with pigetmsg -node and Windows authentication, but run pigetmsg locally on every UniInt interface node, because a PINS node answers a remote query with error -10758 instead of messages. Collect from yesterday's midnight with -st y -et *, append every output with >>, and copy the interface exports into one report.

On this page
- How do I collect messages from 8 PI servers and 16 interface nodes without logging in to each one?
- Which pigetmsg command reads yesterday's messages from a remote PI Data Archive?
- Why does pigetmsg fail on an interface node with error -10758?
- How do I append every node's export into one daily report file?
- How much of the day does -st y -et * actually cover?
- Can pigetmsg pull only errors, or only warnings?
- Where do UniInt interface messages go when pipc.log looks quiet?
- What does the collection need to run unattended every day?
- Questions asked
Collect the eight PI Data Archives remotely with pigetmsg -node and Windows integrated authentication, and run pigetmsg locally on each of the sixteen UniInt interface nodes, because a PINS node answers a remote query with error -10758 instead of messages. Append every output with >> so all 24 machines land in one file, copy the interface exports in, and schedule the run within minutes of midnight so -st y -et * covers the 24 hours the daily report promises. One scheduled job then replaces a day of manual logins across every site.
How do I collect messages from 8 PI servers and 16 interface nodes without logging in to each one? #
Split the fleet by role: the 8 PI Data Archives take a remote pigetmsg query with -node, while each of the 16 UniInt interface nodes needs a local export plus a file copy — 40 automated steps a night replacing 24 manual logins.
The nightly arithmetic: 8 remote queries + 16 local exports + 16 file copies = 40 steps across 8 + 16 = 24 machines. Build the inventory before writing any script: one row per machine with its role, interface version where known, logging destination (PI Message Log, pipc.log, or both), retrieval method, and the time zone the report is written against. This report is diagnostics for people, not process data, so it stays out of your tag store — choosing a site historian for a PC-based SCADA host is a separate decision with its own criteria. Then fix the run order:
- On the collector, run one remote pigetmsg per archive with -node and -windows, appending each result into the combined file.
- On each interface node, run pigetmsg locally with no -node to write that node's export file.
- Copy each interface export to the collector and append it into the combined file in a fixed node order.
- For an interface older than UniInt 4.5 that still logs only to pipc.log, copy the text file instead of exporting.
- Check every file's earliest and latest timestamps and line counts before the report leaves the building.
- Keep one output file per node during commissioning and combine only after each node has passed on its own.
Decide the branch per machine from the inventory, not from hope: archives remote, UniInt 4.5 and later as local export, legacy pipc.log nodes as file copy.
Which pigetmsg command reads yesterday's messages from a remote PI Data Archive? #
Run pigetmsg -node mypidataarchive -windows -st y -et * >logs.txt from the collection machine: -node selects the remote PI Data Archive by hostname or IP address, -windows authenticates with Windows integrated security, -st y begins at yesterday's midnight and -et * ends at the current moment.
| Command part | What it does |
|---|---|
-node mypidataarchive |
queries the remote PI Data Archive named on the command line |
-windows |
authenticates with Windows integrated security |
-st y |
begins at yesterday's midnight |
-et * |
ends at the current moment, not at a fixed midnight |
>logs.txt |
creates the output file or replaces its existing contents |
Test one archive from the collector under the account the job will actually use, because a command you launch by hand and the same command in a scheduled task can run under different Windows identities with different reach. The PI Server documentation lists every pigetmsg option, and the Data Archive utilities share one set of connection options. The PowerShell message cmdlet is the other documented route, but it works locally on the archive and older archives may refuse the connection, so -node pigetmsg is the one remote method that behaves the same way on every archive. If one archive install is too old for the remote connection options, drop that single node to the local-export branch with the interface nodes.
Decision: run -node against all eight from one collector, and let any refusal fall to the local branch.
Why does pigetmsg fail on an interface node with error -10758? #
An interface node cannot be queried remotely: on a node running UniInt 4.5.5.22 the archive command returns Error occurred in command line processing: [-10758] Failed to create remote connection, because the PINS node where the interface resides lacks the authentication mechanisms a PI Data Archive exposes to remote sessions.
Run the export on the interface node itself, with no -node:
pigetmsg -st y -et * >logs.txt
The file is written on that node; copy it to the collector afterward. Re-running the query remotely from the PI Data Archive changes nothing, because the missing capabilities belong to the interface node, not to where you stood when you asked.
| What you see | What it means | Next step |
|---|---|---|
| Archive query succeeds, interface query returns -10758 | the interface node's remote message connection is not equivalent to the archive's | run pigetmsg locally on the interface node |
| Local query returns messages | the message store and the local retrieval path work | transfer the exported file to the collector |
| Local query also fails | the problem reaches beyond remote authentication | check the local logging service, the utility's presence, and the account that ran it |
UniInt 4.5 and later tells you where the messages live; it does not guarantee the node accepts a remote pigetmsg connection. Keep storage location and retrieval method as two separate decisions, and never spend another night retrying the same remote query — export locally and copy.
How do I append every node's export into one daily report file? #
Use >> instead of >: pigetmsg -st y -et * >>mylogs.txt appends to an existing file, while the single > creates a new file or overwrites the old one, so a nightly batch can build one combined file across the fleet without erasing earlier nodes' output.
rem on the collector, once per PI Data Archive:
pigetmsg -node mypidataarchive -windows -st y -et * >> daily-messages.txt
rem on each interface node, run locally:
pigetmsg -st y -et * >> daily-messages.txt
rem then copy that node's daily-messages.txt to the collector
The combined file is only useful if you can still tell nodes apart, so append the archives first and the interface nodes in a fixed order, or keep one file per node and combine at the end; check one export before assuming the message lines carry node identity. Retry a failed node into its own per-node file and append that file after the repair — appending a repaired run straight into the combined report with >> would duplicate the window instead of replacing it.
Commission with one file per node, operate with >> into one combined report, and keep retries off the combined file.
How much of the day does -st y -et * actually cover? #
It covers yesterday's midnight up to the minute the job runs: a 06:00 schedule collects 30 hours where the report promises 24, so put the job within minutes of midnight — at 00:05 the same pair spans 24 hours and 5 minutes.
Worked example, with an illustrative 06:00 schedule: -st y anchors at yesterday 00:00 and -et * resolves to the current moment, 06:00 today. Coverage = 24 h (all of yesterday) + 6 h (today up to 06:00) = 30 h, and 30 ÷ 24 = 1.25, so the window runs 25% longer than the 24 h the client asked for. Move the schedule to 00:05 and the same options span 00:00 yesterday to 00:05 today, 24 h 5 min; a run at midnight itself gives exactly yesterday 00:00 to today 00:00, 24 h.
Schedule within minutes of midnight and stamp the report with the window it actually collected: a 06:00 report either declares 30 h or moves its boundary, and -st y does not move with it.
Can pigetmsg pull only errors, or only warnings? #
It pulls a floor, not a slice: the documented -se example returns the errors and the critical, and pigetmsg offers no way to read one single severity such as warnings only, so collect the full day unfiltered and split by severity during reporting.
-se reads messages from a minimum severity upward, and each message carries its severity as a single-letter code in the export, which is what makes reporting-time filtering reliable. Collect the full day once without the filter, then split the combined file on that code in the spreadsheet step — one collection pass, two views. If the client wants a short exceptions page on top, add a second -se pass per archive rather than weakening the full report.
One unfiltered collection per node; severity separation happens at reporting time, with -se reserved for the optional digest.
Where do UniInt interface messages go when pipc.log looks quiet? #
UniInt 4.5 and later write interface messages to the PI Message Log instead of only to pipc.log, so a quiet pipc.log often means the messages moved rather than that the interface stopped reporting, and pigetmsg is what reads them.
Each interface message in the Message Log carries the interface version, the UniInt version and the command line that produced it, and some newer interface releases write messages that only pigetmsg can view at all. The test is quick: run a local pigetmsg on the node and compare it against the tail of pipc.log — if the file is quiet while the query returns messages, the destination moved. For an interface that still logs only to pipc.log, copy the text file from the interface node's installation directory to the collector under a node-specific name, confirming the real installation path rather than treating any illustrated directory as universal.
Read the logging destination from the inventory first: Message Log means pigetmsg, pipc.log means file copy, and a node writing both needs both.
What does the collection need to run unattended every day? #
One dedicated account tested end to end: schedule the job under the same Windows identity you validated by hand, give that identity access to every export location and copy share, and verify the combined file's earliest and latest timestamps and line counts before the report goes out.
Failures are silent by nature — a node that could not be queried simply contributes no lines — which is why the timestamp and count check is part of the run, not an optional extra. Treat the copy step as load-bearing as well: when a transfer component stops, everything downstream stops with it, exactly how a stopped eSync File Catcher halts remote sync and SQL logging. Run the whole job under a dedicated least-privilege account rather than a personal administrator login, and keep the collection folder's permissions limited to the accounts that need it. Carry the report time zone in the inventory, because timestamps arrive from machines in different sites.
The nightly go/no-go is one check: 8 remote exports, 16 local exports, 16 copies, zero logins — any gap names the node that failed.
Questions asked
What do the single-letter severity codes in the export mean?
pigetmsg shows each message's severity as a single-letter code: C marks Critical, E marks Error and W marks Warning, and Information carries its own code in the same column. When a client wants errors separated from warnings, split the combined file on that code during reporting, because the utility itself cannot select one severity alone.
Does pigetmsg need a separate installation on each machine?
No separate step is needed. The PI Data Archive ships its command-line utilities as part of PI Server, and on interface nodes pigetmsg arrives with PINet Manager, so the machines you already administer carry it. Verify that the utility is present and runnable on every interface node before you schedule the collection.
Why does a manual test succeed but the scheduled run collect nothing?
Windows integrated authentication gives each run whatever its own identity can reach, and a scheduled task does not always run as the login that tested the command. Re-run the test under the exact scheduled account, then confirm that account reaches every export location and the copy share before the first unattended night.
What rights does the pipc.log copy need?
Read access to the file alone is not enough. Copies that travel over an administrative share such as c$ need administrator rights, so run the copy under an approved service account and land the files in a dedicated collection folder whose permissions are limited to the accounts that genuinely need them.


