Pandora FMS Agent not connecting to localhost tentacle server

This is one of those silly gotchas that works on some servers but not on others. On servers you’ve probably gotten used to common server processes like mysql and ssh and so on listening on all IP addresses (0.0.0.0).

Doesn’t work that way on virtual (e.g. venet0) interfaces used with virtual servers. Few things get to have bindings like 0.0.0.0:port.

You probably know the answer now – If your tentacle server is bound to a specific IP then if the Pandora Agent (client) on the actual Pandora Server itself tries a default of “localhost” i.e. connect to itself then that isn’t going to work at all if the tentacle server is not listening on 127.0.0.1/0.0.0.0 but is listening on a specific IP address.

Fix is easy – do a netstat -an | grep 41121 and you’ll see something like…

tcp        0      0 X.X.X.X:41121     0.0.0.0:*               LISTEN

where X.X.X.X is an actual IP address and not 0.0.0.0.

In the /etc/pandora/pandora_agent.conf then set the server_ip to that IP address or, better, set it to the domain name that resolves to that IP.

Fixing Default font doesnt exist in PandoraFMS v4 console

This is a first-day-of-use error message that will appear as a warning triangle at the top of your PandoraFMS v4 Administration Console. The fix is easy. Go into the menu option,

Administration -> Setup -> Visual Styles

and set the  Fontpath option (it will be set but not saved into the new
database schema) and then do an Update on that page just the once.

That clears that warning triangle message. If you didn’t notice then the warning triangle appears at the top near your username and logout icon.

Using audacity to create auto attendant /IVR prompts (low cost)

If you are getting someone to say the script (or yourself !) in-house and want a low-cost recording solution without a professional sound recording setup then I use Audacity with an ordinary microphone from a VOIP headset and a few tweaks. Audacity is a good Open Source digital audio recorder and effects processor.

I use a piece of A4/Letter (80gsm) photocopy/LASER copier paper between your mouth and the microphone. This will de-pop your speech. It makes a dramatic difference. Just hold the paper from the bottom so you can still see over it to read the script on your computer screen but don’t have the paper touch the microphone or your mouth (lips, beard, moustache etc).

Open Audacity and set the project rate to 16000 Hz and the input as 1 (Mono) Input. The input is in the Device toolbar (See View->Toolbar -> Device toolbar to make sure it is displayed).

Have your script visible on the computer screen, the de-popper paper held in one hand between the microphone and your mouth and click the record button.

Wait a few seconds to get the background noise (i.e. allow the microphone to pick up the ambient noise because we need to remove this later) then speak your script at a normal pace. At the end leave a few seconds of silence and then click the stop button.

Now select the starting silence (not your words or any clicks from your mouse button at the very start) and click the option Effect->Noise removal and then click the option button in the noise removal Step 1 of “Get noise profile”. It remembers this so now select ALL the audio and then redo the Effect -> Noise removal and take the defaults and click OK.

If you listen it should now be dead silent between words and phrases that you say.

Now select the silence at the start and use the scissor tool to cut this. Select the end silence and use the scissor tool to cut that. Note that you might see a tiny click at the start and end which is the mouse click when you clicked the Record button. Cut this out as well.

That is about all you need to do. Save this as a Audacity PROJECT and then export it as a 16 bit PCM wav file. Upload this and see if it works for you. If the volume is too low then re-open the Audacity project and use the Effect->Amplify to adjust this and then re-save as a new WAV file.

Other tricks are to use Bass boost effect to give your voice some gravitas or to use pitch controls, though you do risk sounding artificial if you alter it too much.

Changing Joomla! MySQL user password without outages.

Changing your Joomla! MySQL database password without a loss of service is done as follows,

1) Open  the existing configuration.php file for Joomla! (found in your web site root) and print or save the details. This gives you a backup copy.

2) Use your cpanel (generally cpanel but there may be other hosting backends to access the MySQL database users) and add a new database user with a suitably strong password. Take care here and observe the cpanel error messages. Unless the password is strong enough it won’t save the values.

3) Assign this new MySQL database user to your existing Joomla database with all privileges.  Thus it is running in parallel with the existing MySQL database user.

4) Now edit the configuration.php file for Joomla! (found in your web site root) and change the two entries,

$db =
$password =

to these new MySQL database user values and then save that file back to the server. Joomla! will now be using this new database user.

5) Then you must verify this is true by going into the administration for Joomla and looking under Site -> Global Configuration ->Server and seeing that the database settings username is the new username.

6) If so then use cpanel to delete the old MySQL username or at  the very least change the password to something new.

Why do it this way – why not just change the MySQL database password ?  Because of timing, you cannot change the MySQL database password and the configuration.php file instantaneously. By adding a new database user that is waiting to be used and then changing Joomla configuration there is no loss of service and you can easily verify that it is working on the new setting by checking the Joomla administration screens.

A third party ideally should not know your MySQL passwords or be able to access your MySQL databases remotely but on shared hosting where there is just one MySQL engine running then any account on that machine can access your databases if they knew the database and username and password details.

Address collision on range extended LAN after re-numbering main LAN

Client had decided to change ADSL provider. They got sent a new ADSL modem and I had to install this. The modem didn’t need any configuring as it was ready-to-go out of the box but its default LAN that it allocated  DHCP was 192.168.1.0/24 rather than the old LAN of 192.168.0.0/24

The client site has a SITECOM AP on this LAN and in another part of the building, a Belkin WIFI universal range extender that extended the WIFI. I had power cycled the SITECOM AP as it got its internet facing IP address from the DHCP server in the ADSL modem, but I never rebooted the range extender as it is in another part of the building and shouldn’t need to be rebooted.

The laptop that connects via the range extender was working fine but every few minutes Windows complained about an address collision.  The laptop is the only device on this range extender. The fix was easy – power cycled the range extender.  So though it shouldn’t need this as it’s using the different address space of the SITECOM AP (which is doing NAT), it did actually need doing.

Imaging multi-session DVDs (non-CSS disk)

On Windows XP a client had a multi-session DVD (non-CSS so non-commercial on a DVD-R) and wanted a copy. Using their PC (a business grade DELL) I had problems with creating an image of this disk using imgburn. Imgburn suggested to create a new layout by hand. I tried that but  ended up with an image that was much smaller (300 MB verses 900 MB) than the original. This got me curious.

I also tried the daemon tools image creation and that could create a .MDS or .MDX file that was the right size but that would not mount in Daemon tools and nor did the daemon tool image burner work on that file.

What I did try was using infrarecorder to create an image. This successfully created a .ISO file that was the right size and could mount this in daemon tools. Infrarecorder could not actually burn this image (it just ejected the disk immediately) but imgburn could.

So the final workflow was,

Infrarecorder -> .ISO -> imgburn

and the client says that the new copy works on their DVD player.

Converting CMYK .PSD files for use in GIMP

Though GIMP has some support for handling CMYK workflow there is one part that isn’t available and that is opening existing Adobe Photoshop files (.PSD) that use the CMYK model.

From a private book or card design point of view the one main place you’ll see these .PSD files is with online printers who provide you with only .PSD files as templates for the media sizes they print on. These files have a few or just one layer of the exact size that you have to make your material and so just happen to specify CMYK model rather than needing this.

GIMP cannot open these type of .PSD files if they use CMYK: GIMP can only open PSD files that use RGB. It will fail with the error message,

Error loading PSD file: Unsupported colour mode: CMYK

…and before you ask, no the separate+ plugin will not work here – that only has support for CMYK Tiff import and it does not alter how the existing PSD import works.

You have three to four options to help here,

a) Use the imagemagick convert program to convert the colour space to RGB and create
a PNG file. See http://www.imagemagick.org/script/convert.php

The command I use is,

convert input.psd -channel RGBA -alpha Set -colorspace rgb output.png

where input.psd is my input filename from the online printer service and output.png is the output filename I give the files.

If this is a single layer then it will create just the “output.png” whereas if it is layers then it will create layers plus one; a merged (or flattened) layer png which it names output-0.png and one file per layer called output-n.png where n is the layer from bottom to top e.g. output-1.png, output-2.png for a 2-layer image.

You may be asking why not make that a .XCF file i.e. the GIMP native format ?. Well if you try making the output a .XCF then you will probably get an error message like “Unsupported compression mode: 33535” if you try with the default compression or “Procedure ‘file-psd-load’ returned no return values” if you try without compression when you open that file in GIMP. So it doesn’t really make it a native GIMP XCF file as you can see that it still keeps the format as PSD. OK so what about .TIFF files ? Well if you try using .TIFF files (which are multiple pages) then it may work if all the pages are the same size but if one layer isn’t then GIMP will bork with “Calling error for procedure ‘gimp-image-resize’: Procedure ‘gimp-image-resize’ has been called with value ‘-2147482750’ for argument ‘new-width’ (#2, type GimpInt32). This value is out of range.” I think its safe to say that you should stay with a bunch of .PNG files.

b) Alternatively use an online web based reader that can work with CMYK mode
PSD files e.g. http://pixlr.com/editor/

c) Get a friend to open and save the file as a multiple page .TIFF or set the colour mode to RGB for a .PSD file for you.

d) Install a trial version of Photoshop. You would have 30 days or so to register so this is quite a complex process and really is a last resort.

Note that I’m only interested in opening these simple printer templates. If you have complex images from a graphics department that has created something for you in Photoshop and has sent you .PSD files then you are advised to use Photoshop if you depend upon a fidelity of the content because though GIMP handles layers in PSD files it has a few differences in any conversion process e.g. it will rasterize what should stay as a vector e.g. Text and other vector objects and it will lose layer masks and effects such as layer styles. Arguably a Photoshop user would be as equally stumped if sent a GIMP native .XCF file.

Also if the provided template actually uses colours and is trying to show you what this will look like (e.g. it is coloured stock) then unless you have setup your whole PC with the correct colour profiles (ICC files for the CMYK and process and your PC screen) then this is all going to be meaningless to you so you’re still going to have to rely on proofs to see if it looks like on paper is what you expected.

Alt-gr key with @ not working on Italian keyboard in Windows 7

A client of ours a while back had picked up an ex-demo laptop and had got the shop they bought it from to install it as English. The keyboard remained as an Italian physical layout (which is a QWERTY layout but has extra accented characters).

Recently I was at their site and tried to use the laptop and noticed the @ (at) symbol wasn’t working. On the wall they had put up a note for people to use an ALT+064 sequence. OK but what !?

The fix was easy though not obvious at first glance (AltGr + q will actually print a @) and it is that there are two Italian keyboard layouts in Windows 7 – Italian and Italian (142).  This was set to “Italian (142)” where the AltGr+q is the @ key whereas it should have been set to just “Italian” where the AltGr+ò key is where the @ symbol is printed.

Added the layout (Language still English (British)) set the default language and layout to be just the “Italian”, and deleted the “Italian (142)” layout. Rebooted it to make sure that any applications hadn’t cached  the layout (Firefox seems to do this).

Keyboard now works as expected.

 

International Amazon Kindle not charging from USB ?

A client of ours had got a Kindle recently and seemed happy with it but the batteries kept going flat.  I checked and it seemed to be charging fine so I dug a bit deeper and this what I found.

The PC is a brand new laptop running Windows 7 Home Premium –  I know as I re-installed that as English a few weeks ago. The power management was left as the default of Balanced.

The quirk with this is that they leave the Kindle plugged in when they go out but the Balanced power setting on Windows 7 by default shuts the PC down in 30 minutes (when on mains) when idle.

The Kindle needs 4 – 6 hours to charge thus it will never really charge unless you stop the Laptop from going into power save mode. I changed the Balanced on-mains power shutdown period to 4 hours to at least give the Kindle a chance to get a charge.

I imagine that other people have had this without really thinking about what is happening.

 

ACER 1360 BIOS 1.15 Model ID check error

I’m recovering a heat-damaged Acer Aspire 1360 and I wanted to update the BIOS. I went to the Acer web site and found the 1.15 version. This didn’t install but failed with a “Model ID check error”.

I re-downloaded the file from a different Acer site (UK and US) but same problem. I then tried the Acer FTP site,

ftp://ftp.acer-euro.com/notebook/aspire_1360/

and sure enough I found the problem.

The old BIOS files had two models in them, the 1520 and the 1360 but the version 1.15 only has the Acer Aspire 1520 files.

So AFAIKS you can only flash to version 1.11 of the BIOS (this gives 64 bit support).

 

Install stuck at “setup is preparing your computer for first use”…

I found an odd fix to a problem on a new client PC. I was re-Installing Windows 7 SP1 on a new Acer laptop so as to change the install language (why aren’t OEMs in the EU mandated that they must offer all available Eurozone languages for their retail products if they already have that language as a first-time selection ?)  and I got the forever hung at “setup is preparing your computer for first use” problem.

If you search the Internet for an answer to this then there is nothing that is very clear as to what you can do when you are sitting in front of  a machine that works perfectly, will install but for the last few steps of the installation, fails to complete.

AFAIKS the cause is slipstreamed installers either stalling or failing and the Windows first use program is just spinning its wheels waiting for them to exit.

What I did at the “setup is preparing your computer for first use” screen was twofold:

1) I clicked SHIFT+F10 to get a command prompt, then typed in devmgmt.msc to get the device manager. It will have the unknown or devices without drivers expanded. I disabled some but I also found that you can install drivers too. If you have all your manufacturer drivers on a USB stick then just right-mouse and select update driver and then browse to the root of your USB stick e.g. E:\ and have it search subdirectories and it should find the right driver for that device.

—-and at the same time I..

2)   typed in taskmgr.exe to get the Task Manager and in  the processes list I killed any running msiexec.exe processes and cmd.exe command prompts if they looked like they were hung i.e. no CPU and the disk light on the Laptop wasn’t really running. This step 2) is the most important step as it seemed to allow the first use setup to step on.

The install then quickly finished the “setup is preparing your computer for first use” stage and I got the username, hostname and so-on questions.

The SHIFT+F10 trick and using the devmgmr.msc and taskmgr.exe works at any stage from the “setup is preparing your computer for first use” display onwards because Windows is actually running only services haven’t started and the hostname and account details haven’t been created.

Hope this helps – it worked for me.

Pandora FMS database first day of use

When you are initially creating the Pandora FMS 3.2.1 on a hosting system then you may hit two problems,

Open_basedir restrictions stop the install script (version 3.2.1) from seeing if the Graphviz binary exists (/usr/bin/twopi ) which is probably there because to get the Pandora FMS installed then Graphviz is a dependency. This shows up as an error on the list of dependencies for the FMS installer web page but if you know that you have the file (/usr/bin/twopi ) then you can click the skip to next step button.

When Pandora FMS creates/updates the pandora MySQL username then it changes the password but unless the RELOAD privilege is on the administration MySQL account then this script fails but it has created the config file. If you are creating the MySQL users via Plesk then this RELOAD privilege is not set. The install fails and you have an empty database. All is not lost – in the pandora_console directory there are two SQL files pandoradb.sql and pandoradb_data.sql. FTP these to your local PC, then use Plesk to create the pandora database and pandora user. Then use the mysqladmin (from within Plesk) to import these two files (it picks them from your local PC). Import both files in turn.

Now edit the /etc/pandora/pandora_server.conf file and set the password that the install created for the pandora MySQL account. Restart the Pandora FMS server ( sudo /etc/init.d/pandora_server restart )

Pandora FMS should now work (the default account is admin and the password is pandora). Obviously on internet-facing Pandora FMS consoles then that is the first thing you change !

 

WordPress media uploads first day of use

On a new server you may find that you cannot upload images and it fails with an error,

Unable to create directory /var/www/path/to/your/httpdocs/wp-content/uploads/2011/06. Is its parent directory writable by the server?

This is because of permissions in that the apache web server can’t write to the wp-content/uploads folder.

The wp-content/uploads folder is defined by default in WordPress under the Settings -> Media and doesn’t need to change but you have to get the web server to be able to write to this location on the first day of use.

If you are using Filezilla or similar FTP Client you must set the file permissions of  /wp-content to 777 then go into your post again and add the image. This should work now and if you look at the wp-content directory you will see a new uploads directory with the file permissions of 777 and owner and group will be the apache web server. Set the /wp-content back to 755.

You don’t need to do anything else. It will keep working from now on.

Obviously the issue of setting 777 on a directory when we’re usually told to not do this raises alarm bells so is this an issue ? On shared hosting it could be an issue. A malicious user on another account could get Apache to upload content to this directory and then hotlink to this content in SPAM emails or bogus web sites but if this is a server or virtual server that you control all the shared accounts then there is no real problem.

A good shared hosting company should have setup the Apache mod_suexec and suPHP module for the virtual host that you are using on the shared account system and you won’t have access to that.

 

Multiple domain name selections

As a minimum we buy the three TLD, .com, .net and .org for a domain name.

With most registrars you can forward the emails and web traffic from the two you don’t use to your main site at no extra cost.

The value of the extra domains becomes apparent when you start adding e-Commerce or company blogs or test or administration sites. Whilst your main public-facing domain can be on e.g. the .com you can host test and development sites on the .net or .org.

With Open Mutual we have our .net as our main public facing web site, this .org as a “blog” and the .com is used for client hosting and is used for our business continuity testing.

Most hosting providers allow you to have multiple TLD (usually up to 10) on the same host (shared hosting reseller account or a V-server)  as well as countless subsites so the cost of running multiple TLD is just the cost of the registry fees (say an extra USD 20 per annum) plus extra time in administration of these extra domains.

If the domains are on completely different infrastructure (different DNS and servers) then the administration site can be used to advertise service status for the live domain.

Done right, the administration costs are neutral because when you are planning your business continuity you can deploy your backups onto the other domain names and hosting accounts without interfering with your live system or, equally, you can install new versions of software on the other domains and test the impact by comparing the live and test systems.

 

Don’t forget that .htaccess

When you install your wordpress site on a new machine then don’t forget to add or change the .htaccess file to allow the permlinks to work properly without getting 404 page errors. What you need to add is right at the very bottom of the WP Admin Settings-> Permlinks administration page. Copy and paste that into the .htaccess file that is (or should be) at the document root of your web site.

If it is not there then you need to create this file. If you are using Windows and try and create a file called .htaccess on your local PC to upload to your web server then you will get an error “You must type a file name”.

Just call it htaccess.txt or similar and then edit that with the WP permlinks related changes and then upload that in FTP. Then rename the file on the server to .htaccess

As the server will be Unix-like then it won’t care about such a filename and now your permlinks will work and you won’t get 404 errors for your posts.