Hi Gabriel,

the following is a live example from my own small system at home :)

sudo home
OMD[home]:~/local$ REMOTE_USER="check-mk" SKIP_AUTHORIZATION=1 php -d
session.save_path=$OMD_ROOT/tmp/php/session
$OMD_ROOT/share/pnp4nagios/htdocs/index.php
"/image?host=owncloud&srv=Memory&view=0&source=0" > test.png

I get a valid png file with the first graph of the Linux memory graphs.
If you change the source then you get the second, third and so on graph if
existing.
The view parameter specifies the time range shown.

Best regards
Andreas

Gabriel Vilela <gabrieldvil...@gmail.com> schrieb am Fr., 6. Apr. 2018 um
21:20 Uhr:

> Good evening Andreas,
>
> Thank you for the help! I tried using the following instruction you showed
> me and got this:
> "session_id|s:26:"v1usv20oj2nddfelqig35il8g6";total_hits|i:232;_kf_flash_|a:0:{}user_agent|s:114:"Mozilla/5.0
> (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko)
> Chrome/65.0.3325.181
> Safari/537.36";ip_address|s:13:"<IP>";last_activity|i:1523042023;theme|s:9:"multisite";sfilter|s:0:"";basket|a:1:{i:0;s:20:"LocalHost::_HOST_::0";}start|i:1523025157;end|i:1523039557;"
>
> I still didn't figure it out what to do but I'll try harder and see what I
> can understand.
> Other than that I kept trying to work with wget, since that's what the
> PNP4Nagios documentation was informing, and again got a HTML file, when
> accessed on a browser it showed me a login page (login.py).
>
>
> I'll try the command you showed me and understand how it works and will
> continue to try the wget.
>
> Thanks once again, Andreas!
>
>
>
>
> 2018-04-02 7:19 GMT-03:00 Andreas Döhler <andreas.doeh...@gmail.com>:
>
>> Hi Gabriel,
>>
>> if you do this on the monitoring host then it is way easier to access the
>> pnp4nagios directly.
>> It is done this way also inside the notification script.
>>
>> Example
>> REMOTE_USER="check-mk" SKIP_AUTHORIZATION=1 php -d
>> session.save_path=$OMD_ROOT/tmp/php/session 
>> $OMD_ROOT/share/pnp4nagios/htdocs/index.php
>> "/image?host=$HOSTNAME$&srv=$SERVICEDESCRIPTION$&view=1&source=1"
>>
>> This is the call to pnp4nagios from the command line.
>>
>> best regards
>> Andreas
>>
>> Gabriel Vilela <gabrieldvil...@gmail.com> schrieb am So., 1. Apr. 2018
>> um 23:05 Uhr:
>>
>>> Good evening!
>>>
>>> I'm trying to export the data from Check MK to a local web report I'm
>>> working on.
>>> I read that PNP4Nagios provides access to the RRD data and you can use
>>> wget to generate images and place them into periodic reports.
>>>
>>> So I gave it a try by using the command below:
>>>
>>> wget -O image.png 'http://
>>> <user>:<password>@localhost/pnp4nagios/image?host=TestHost&srv=_HOST_&source=0&view=0'
>>>
>>> And every single time I tried that command I kept getting the error
>>> message: "2018-04-01 17:01:18 ERROR 404: Not Found".
>>> When I added my site name before localhost (@localhost/<site
>>> name>/pnp4nagios/...) the command went through but it did return a HTML
>>> file stored into image.png.
>>>
>>> Right now I don't know what else I can do because that used to be the
>>> way I managed to export the graphs as images and add them to my reports.
>>>
>>> Did anyone ever tried to do that or had a similar experience?
>>>
>>> Thanks in advance!
>>>
>>> Best regards,
>>>
>>> Gabriel
>>>
>>>
>>> _______________________________________________
>>> checkmk-en mailing list
>>> checkmk-en@lists.mathias-kettner.de
>>> http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en
>>
>>
>
_______________________________________________
checkmk-en mailing list
checkmk-en@lists.mathias-kettner.de
http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en

Reply via email to